Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks, crescentfresh, for getting me on the right track. For my solution, I modified my scripts to print only the elements nested within the forms as opposed to the forms themselves and their contents. I then changed the "target" of each form to the next form instead of the div containing the next form. This eliminates the need to re-bind the submit event for each form since the ajax function from the previous form merely replaces its inner elements instead of "refreshing" it altogether.</p> <p>I also decided it was appropriate to do away with the form plugin and simply use ".serialize()" along with ".ajax" as illustrated by Paolo Bergantino <a href="https://stackoverflow.com/questions/550370/jquery-form-returned-on-success-needs-re-binding">here</a>.</p> <p>My final product looks something like this:</p> <pre><code>/* Form 1 */ $('#frmSearch').bind('submit', function() { var formdata = $(this).serialize(); $.ajax({ url: 'result_form.php', data: formdata, success: function(responseText){ $('#frmResults').html(responseText); } }); return false; }); /* Form 2 */ $('#frmResults').bind('submit', function() { var formdata = $(this).serialize(); $.ajax({ url: 'lookup_div.php', data: formdata, success: function(responseText){ $('#frmLookup').html(responseText); $('#frmLookup').trigger('submit'); } }); return false; }); /* Form 3 */ $('#frmLookup').bind('submit', function() { var formdata = $(this).serialize(); $.ajax({ url: 'mapped_items_div.php', data: formdata, success: function(responseText){ $('#divMappings').html(responseText); } }); return false; }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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