I have a form on my jQuery Mobile website that I would like to validate and stop submitting if validation fails.
However, "return false" does not stop form submission because jQuery Mobile submits the form via Ajax. How can I stop submitting a form?
$("#form").live('submit', function(){ alert('test'); return false; });
The code above triggers a warning but does not stop the form from submitting. If I use data-ajax = "false" in the form tag, it works correctly, but I would prefer to use the Ajax view if possible.
source share