I'm trying to add some validation to some form fields in a jQuery Mobile site I'm building with a PHP back end.
I've done this in the past successfully using the jquery.validate plugin but I'm having trouble getting this to work with jQuery Mobile.
As an example I have a form similar to the loginForm.php that is in the PHP example site of the "Master Mobile Web Apps with jQuery Mobile" that I recently purchased (it's the login form at http://store.elated.com/products/jquery-mobile-book/task-tango/).
I would like to add validation like this example:
http://jsfiddle.net/elijahmanor/3Rmdm/1/
but having trouble getting it to fire when I click the submit button. From what I've read I can't use the usual:
$(document).ready(function(){
approach but not sure what to replace this with?
Would really appreciate any assistance here.
Thanks
I've done this in the past successfully using the jquery.validate plugin but I'm having trouble getting this to work with jQuery Mobile.
As an example I have a form similar to the loginForm.php that is in the PHP example site of the "Master Mobile Web Apps with jQuery Mobile" that I recently purchased (it's the login form at http://store.elated.com/products/jquery-mobile-book/task-tango/).
I would like to add validation like this example:
http://jsfiddle.net/elijahmanor/3Rmdm/1/
but having trouble getting it to fire when I click the submit button. From what I've read I can't use the usual:
$(document).ready(function(){
approach but not sure what to replace this with?
Would really appreciate any assistance here.
Thanks



