Problem running jquery plugin validate after ajax call to page.
I have a form page that I wish to validate with the jquery plugin validate found here
http://docs.jquery.com/Plugins/Validation
Now the problem if I link to the page this is on using the rel="external" so that the page is not called via ajax it works fine
(IE <a href="http://localhost/index.php?id=2" rel="external">Add</a>)
but if I link to it using the default ajax link
(IE <a href="http://localhost/index.php?id=2">Add</a>)
then the form is not validated and is just submitted as normal and since there is no action set it just returns back to the form.
the code for validate call is as follows
- $(document).bind("mobileinit", function(){
- $.extend( $.mobile , {
- ajaxFormsEnabled : false
- }
- )
- });
- $(document).ready(function() {
- console.log('DocReady.');
- $('#PrimaryParentForm').validate({
- submitHandler: function(form) {
- console.log('Validate Done.');
- postForm();
- }
- });
- });
It runs line 9 and 10 but not 11,12,13,14 and no error messages in the console either.
So I can run this without the ajax call, but to me that defeats the point of jquerymobile.
Any suggestions.