0

Hello guys,


I have implemented the jquery validation in one of my projects.

I have a <div> which has all the billing details
& another <div> below it which has the shipping details.
There is a checkbox in between these <div>'s which says "Same as Billing Address". It is used to populate all the shipping fields from the billing fields.

Well, on this particular form there are some fields which are mandatory & which I have validated by jquery validation.

I have used the $("#form_id").validate().form(); statement to check validation on the click event of the checkbox.
The actual problem is that after page loads, I directly click on the checkbox & submit the page,
the page gets submitted & validation does not execute.
If I click the submit button with the checkbox unchecked then the validation runs properly.

Why is my form not being validated if I checked the checkbox?
Please guys, help me out.


Thanks in advance.

Bhavik.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by kainil
0

If you haven't resolved this problem on your own yet: Sounds like you have not properly attached the validation to the click event or are replacing it with another click event (maybe your field copy function?). There are really too many possible issues to speculate further... Seeing the code would help.

0

If there is too much code for the whole program copy here the two divs and the validation so that we can look at the actual code. Also, why the second form() in the validation?

$("#form_id").validate();

should do the trick. Check http://plugins.jquery.com/project/jqueryvalidate.
Otherwise I would also suggest that you've probably improperly attached the validation to the events.

Cheers

Edited by kainil: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.