Go Back To Code List
[AJAX]
Current Code Entry
Go Back To Code List
[AJAX]
AJAX submit form without Refreshing the page - Classic ASP
Article Entry Date: May 24,2022 @ 10:15:28 / Last Updated On: October 25,2022 @ 03:00:40
Submitting the form without refreshing the page is used on more sites than other types of JavaScript. This process allows the user to stay on the current page without losing their positioning on the page.

Take Facebook, for example. If this technology were not available, you would lose your spot on the page every time you comment on someone else's post. And as websites get bigger and with more users online making posts, it will only worsen, and that is where [Ajax] comes in to soothe the beast we call the Internet.


Using this AJAX script, we have to do something a little different from what we would normally do when passing data to our back-end processing page. We will need to have a hidden field with an ID value that we can pass through our AJAX to our back-end.



First, we have our button, and since AJAX cannot get the value of a button, we will need to do some JavaScript trickery to get its value to pass along.
This is where the Hidden field comes in. We will get the value from the Submit button of "Code" and then it to our page. This way, we can use code like this: