Michael Sole
asked on
JQuery validation plugin being ignored
I am using this (and a few other plugins) http://docs.jquery.com/Plugins/Validation to validate this form
http://lombardiassoc.myclient-review.com/test.php
Click, New (to empty the form) and then Submit and the validation code is being ignored. This was working and at some point it broke. I tried disabling all the non-necessary javascript and the problem is still happening. I need a second set of eyes to help me troubleshoot this. I am sure its something simple, I am just over looking it.
Please help
http://lombardiassoc.myclient-review.com/test.php
Click, New (to empty the form) and then Submit and the validation code is being ignored. This was working and at some point it broke. I tried disabling all the non-necessary javascript and the problem is still happening. I need a second set of eyes to help me troubleshoot this. I am sure its something simple, I am just over looking it.
Please help
ASKER
Yeah normally this script just works. However I had setup a test version of the form and forgot to make a change so it went to the login form and yes that is working. I typically develop in Chrome.
http://lombardiassoc.myclient-review.com/test.php
Please try this one.
I prefer to use the class method of identifying validation rules as it is quite a bit simpler to track, especially on forms with lots of fields.
http://lombardiassoc.myclient-review.com/test.php
Please try this one.
I prefer to use the class method of identifying validation rules as it is quite a bit simpler to track, especially on forms with lots of fields.
You have a AJAX request on line 61. Comment that out temporarily and see if that fixes it. I think it could have something to do with the form repopulating on submit... Not sure, give it a shot...
ASKER
I did try commenting all of the javascript except the form validation and the problem still occurs.
I have removed the ajax completely.
I have removed the ajax completely.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
kozaiwaniec, thank you so much. You've given me a narrower field to troubleshoot.
The thing is, it did work at some point but I added much since then, I suspect I might of changed the JQuery version and that the metadata plugin might not be compatible.
Regardless, I believe I have things I might try now.
Happy New Year to you!
The thing is, it did work at some point but I added much since then, I suspect I might of changed the JQuery version and that the metadata plugin might not be compatible.
Regardless, I believe I have things I might try now.
Happy New Year to you!
Cool. Let me know if you figure out what was wrong.
Happy New Year to you too!
Happy New Year to you too!
ASKER
Hey I know I closed the question but, I re-wrote the validation to not use the class/metadata method.
However I have one last odd problem, the last field causes the validation to be ignored and I can't see why that would be. If I remove it
claimantAltPhone: {
phoneUS:true
}
It works. Any thoughts?
However I have one last odd problem, the last field causes the validation to be ignored and I can't see why that would be. If I remove it
claimantAltPhone: {
phoneUS:true
}
It works. Any thoughts?
ASKER
Nevermind, I accomplished what I wanted by using the mask plugin, however it is a strange bug.
Again, re-writing to use the not class method is how I went about fixing the problem.
Thanks again!
Again, re-writing to use the not class method is how I went about fixing the problem.
Thanks again!
It might have something to do with it not being required. Try it with required:true to test this theory...
OR,
required:false
just a thought..
required:false
just a thought..
ASKER
I did try that, it didn't work. However required:true did.
Since there is only one condition, you could try writing it this way:
claimantAltPhone: "phoneUS"
Let me know if that works.
claimantAltPhone: "phoneUS"
Let me know if that works.
ASKER
Ah the quotes!
Thats what I was missing, forest through the trees :)
Thats what I was missing, forest through the trees :)
:)
I use this script too, though slightly differently. here's mine if it helps:
(Obviously you would need to customise to your needs)
Open in new window