Submitting a Form Using Ajax - J Query

You have a form that you would like to submit using Ajax:


Find the <form>element, and hijack the submit event:


What will happen when JavaScript is disabled? The form will be submitted, and the entire page will refresh with the results from the server-side script. I use JavaScript to alter the value of the <input type="hidden" name="usingAJAX" />element from falsetto true. This allows the server-side script to know what to send back as a response— either a full HTML page or whatever data is expected for the Ajax response.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

J Query Topics