[jQuery] Re: If statement in form validation

2009-05-15 Thread Craig Hoffman
Thanks James, I appreciate your explanations. After some fumbling around I got it work with basically the same thing: billing_first: { required: function() { return $("[name=billing_addr]:checke

[jQuery] Re: If statement in form validation

2009-05-15 Thread James
Try changing it so it's: required: function() { return $("[name=billing_addr]:checked").val() == 0; } and remove your click binding function. This makes the radio check done on runtime. Doing: return billing_address == 0; will probably only evaluate "billing_address" when the rules are defined

[jQuery] Re: If statement in form validation

2009-05-15 Thread choffman
Thanks James I appreciate you replying. I'm still having some trouble, even with your additions. I changed the checkbox to radio buttons. I added this code snippet to get the value of the checked radio. Yes == 1 and No == 0, if the user selects No (0) then the billling address fields need to be

[jQuery] Re: If statement in form validation

2009-05-14 Thread James
Something like: rules: { first: "required", last: "required", .. billing_first: { required: function() { return billing_address == 1; } }, billing_last: { required: function() { return billing_address == 1; } }, billing_first: {