Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Looks like you're handler is not being loaded for the latter browsers... Since the content of the form is dynamic you've gotta make sure is loaded into the DOM before setting the form's handler.</p> <p>You have 2 possible solutions.</p> <p>First, once the tab content is loaded, load the piece of script you posted (check jquery doc for tab event load: <a href="http://docs.jquery.com/UI/Tabs#event-load" rel="nofollow noreferrer">http://docs.jquery.com/UI/Tabs#event-load</a>).</p> <p>Second, use jquery live event on button click (currently event submit is not supported). Check out: <a href="http://docs.jquery.com/Events/live" rel="nofollow noreferrer">http://docs.jquery.com/Events/live</a></p> <p>The code for the second solution:</p> <pre><code>$('#subform input:submit').live('click', function() { // catch the form's submit event - should I use the form id? $.ajax({ // create an AJAX call... data: $(this).serialize(), // get the form data type: $(this).attr('method'), // GET or POST url: $(this).attr('action'), // the file to call success: function(response) { // on success.. $('#pwd-settings').html(response); // update the DIV - should I use the DIV id? } </code></pre> <p>}); return false; // cancel original event to prevent form submitting });</p> <p><strong>First solution</strong></p> <p>These are the changes I made to get it to work:</p> <ol> <li>Remove generic.js from tpl_overview.tpl</li> <li><p>Change the code (@tpl_overview.tpl):</p> <p>$(function() { $('#tabs').tabs() });</p></li> </ol> <p>with this code:</p> <pre><code> $(function() { $("#tabs").tabs( { load: function(event, ui) { // load specific script to handle form submission if ($(ui.tab).attr('href') == '#pwd-settings') { $.getScript('generic.js'); } } } ); }); </code></pre> <p>This will load and execute the generic.js script after the content of the tab is loaded.</p> <p>If you see yourself doing this too many times, perhaps you can name your scripts after the tab link names...</p> <p>Let us know if it worked!</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