Submit a <form> without reloading

December 5, 2012 9:54 am Published by Leave your thoughts

If you have a form on your PHP-enabled website and want to submit it without reloading the page,

  1. Add this below the form:


    <div class="success" style="display:none"> Thank you for submitting. </div>
    <script type="text/javascript">
        if (typeof jQuery == 'undefined') {
            document.write('<script src="' + ( (location.protocol == 'file:') ? 'http:' : location.protocol ) + '//">\x3C/script>');
    <script src="send-form.js" type="text/javascript"></script>
  2. Upload the contents of (2 KB) to your page location.


Thanks to phpmind for the original code.

Categorised in:

This post was written by rado

Leave a Reply

Your email address will not be published. Required fields are marked *