Embedded HTML5 Form in JavaScript Post Method Appends Url to Existing URL (Form Submit Appends URL)

Question: How do you Make an HTML5 Form that is injected by JavaScript Post to the correct root URL? I have a form that is appending Post Method URL to an existing URL, I want it to post to mydomain.com/method but it is posting to mydomain.com/index/method


1. If you are working in Visual Stuido 2019, Stop the Application and Clean the Solution.
2. If needed, close Visual Studio 2019 and restart it, load the project you are working with.
3. Clear or hard refresh the browser if you are working with Google Chrome update the Browser
4. Make sure the url in the method directive in the embended Form starts with a slash e.g.

   method = "/myfunction"
5. Test again.

Edit this Article
JavaScript form not posting to URL JavaScript appends url without reloading JavaScript published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy