I am using the validator.js however I can't seem to work out a way to do this.
I have a form page that has a question with two radios with the values yes and no if yes is selected then a text input is required in a text field input if no is selected them it is not required. Does anyone have any ideas on how to use the validator.js to do this?
if you replace value 'no' with the empty string ''
then you should be able to use 'r' (required) key to make sure 'yes' is selected.
You can also use checkbox in this case.
thanks i will try that and let you know how i get on.
is there anyway to make the 'alphanum': /^w+$/, work so it will accept spaces?
you can just add another type to the list, say: