Hi all,
I am using a custom function so that I can implement a 'THIS OR THAT' type check.
I have two fields and one OR the other OR both need to be filled in.
The issue is that if I dont use the required class an empty field, though returned as false by my custom function, is not counted as a validation fail when the form is submitted.
If I use the 'required' class then it confuses the users and also means I have to add/remove this class between the two fields depending on if they are empty or contain the right stuff.
Am I missing something here..?
Form
<input name="pHourCredits" type="text" id="pHourCredits" class="validate['@checkHours']" size="4" /><span class="inputAfter">days</span>
OR
<input name="pHourCreditsHours" type="text" id="pHourCreditsHours" class="validate['@checkHours']" size="4" /><span class="inputAfter">hours</span>
custom function 'should' always invalidate the form
function checkHours(el){
el.errors.push("You must enter either the number of days or total number of hours.");
return false;
}
Any ideas without going through the hula of adding the required class on submition then removing it and so on