Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>While all browsers handle the storage and autocomplete of form fields in slightly different manners, they all rely on the form being submitted in order to store the values of the form fields themselves. As jqGrid handles the forms through AJAX (the update button is a link not a submit button), the forms themselves are never actually submitted, which in turn never allows the browser to store the field values for later use through autocomplete.</p> <p>One method of forcing the browser to store the field values, is to create an <code>&lt;iframe /&gt;</code>, clone the <code>&lt;form /&gt;</code>, append the cloned <code>&lt;form /&gt;</code> into the <code>&lt;iframe /&gt;</code> and submit it as part of the AJAX form submission process.</p> <p>Take for example this modified version of your <a href="http://jsfiddle.net/fKhVX/11/" rel="nofollow">JSFiddle</a>.</p> <p>In the above example, fill out the 'Standard Form' and submit, reload the page and the fields are autocompleted as expected. Fill out the 'AJAX Form' and submit, reload the page and the fields are NOT autocompleted. Finally, fill out the 'AJAX + iFrame Form' and submit, reload the page and the fields should now autocomplete.</p> <p>*Note: The above example was tested on Chrome, Safari and Firefox. Your Milage may vary.</p> <p>For completeness, here is the relavent code:</p> <pre><code>$('#iframe_submit').bind('submit', function(e){ e.preventDefault(); // Prevents Standard Submit // Do AJAX Stuff Here... // Create Clone of Form, Append to iFrame and Trigger Submit // This Forces Autocomplete to Register var $clone = $('#iframe_submit').clone(); $clone.attr('id', 'iframe_clone'); // Only One ID Allowed $('&lt;iframe /&gt;').appendTo('body').contents().find('body').append($clone); $('iframe').contents().find('#iframe_clone').submit(); }); </code></pre> <p>I hope this helps!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload