Validation - cant set rules
I have tried this so many ways that I am totally lost.
I have a form with a field that is only visible when an radio button is selected so I have been trying to set a conditional validation.
I have reduced this to simple try and make the field required as follows:
<script>
$(document).ready(function(){
$("#formId").validate({
rules:{
fieldid:{
required: false
}
}
});
});
</script>
This has no effect. Other fields on the form have required set using the class method and these work fine.
As a test I have trried to extract the rules back from the form using $("#formid").rules(); but this wonders of in the void never to return.
I am using jquery 1.4.2 and version 1.7 of the validation plug in. Browser is Firefox 3.5.9 on SUse Linux with Firebug and Tamperdata add-ons.
Any suggestions to which stupid error I am making very much appropriated, it must be a stupid error because they are the ones it takes longest to find!
Many thanks.