[jQuery] Re: Only one of two fields is required. How to implement this logic in Jquery form validation?

2009-10-11 Thread Don Dunbar
I thought of a much simpler solution. If possible could you use radio buttons for those two choices in your HTML? In a radio button group selecting one automatically deselects other buttons in the group. Then you could just use one of the built in validation checks, as you already have done, to mak

[jQuery] Re: Only one of two fields is required. How to implement this logic in Jquery form validation?

2009-10-11 Thread Phper
I am not familiar with the syntax of Jquery plugin. On Oct 12, 2:19 pm, Don Dunbar wrote: > Hi , I double checked on javascript's XOR operator and it only works with > bitwise: so you will have to write your own XOR . This isn't hard :   [code] > if (!foo != !bar)  [\code] should work for all e

[jQuery] Re: Only one of two fields is required. How to implement this logic in Jquery form validation?

2009-10-11 Thread Satyakaran
whats the problem? just check one field, it it is filled then do not check other. may be your problem is something else On Oct 11, 8:37 am, Phper wrote: > There are two input fields in a form, but only one of them is > required, they are not required at the same time. Either A or B is > required

[jQuery] Re: Only one of two fields is required. How to implement this logic in Jquery form validation?

2009-10-11 Thread Don Dunbar
Hi , I double checked on javascript's XOR operator and it only works with bitwise: so you will have to write your own XOR . This isn't hard : [code] if (!foo != !bar) [\code] should work for all elements. or this [code]if( ( foo && !bar ) || ( !foo && bar ) )[\code] For the validator meth

[jQuery] Re: Only one of two fields is required. How to implement this logic in Jquery form validation?

2009-10-11 Thread Phper
http://code.jquery.com/jquery- latest.js"> http://dev.jquery.com/view/trunk/ plugins/validate/jquery.validate.js">