jQuery Mobile: Submitted form not staying on "thank you" page -
i'm new jquery mobile, have started using wordpress site that's supposed used via smartphone. way looks added jqm equation.
the problem have after submit form, correctly takes me "thank you" page, @ point single line of text reading "thank playing", after goes original form came from. might not able explain better, recorded video issue here: http://screencast.com/t/qmd0bprosg
if disable ajax "$.mobile.ajaxenabled = false;" works, meaning doesn't go form, having ajax enabled , working way it's supposed to, rid of couple of other issues have. fixing behaviour save me lot of time!
here's html:
<form id="stop-spin" action="/thanks-for-playing" method="post"> <input type="hidden" id="stop-spin-nonce" name="stop-spin-nonce" value="c96ef6a79f"> <input type="hidden" name="_wp_http_referer" value="/spinner/"> </form> <div class="play-button"> <a href="javascript:void(0);" id="start-rotation" class="ui-link"></a> <a href="javascript:void(0);" id="stop-rotation" style="display: none;" class="ui-link"></a> </div>
i removed elements sake of simplicity, it's worth noting form doesn't have button inside, capture click event of #stop-rotation anchor via jquery , form submit there.
here's jquery:
$( document ).on( 'pageinit ready', function() { $( document ).on( 'click', '.play-button a#stop-rotation', function() { $( '#stop-spin' ).submit(); }); });
i might missing obvious here, can me out this?
at moment little app local only, can try , build fiddle or upload test server if wants take @ whole.
thanks in advance assistance
corrected code, should job. you'll never need ready() event in jqm, replace pageinit() or pageshow() example.
$( document ).on( 'pageinit', function() { $( '.play-button a#stop-rotation' ).on( 'click', function() { $( '#stop-spin' ).submit(); return false; }); });
Comments
Post a Comment