client side validation, how to and js error
On my checkout confirm page, I have a form to allow the customer to choose a shipping method.
I now have a requirement to allow the customer to select ‘Prepaid shipping’.
If the customer chooses Prepaid, a script makes the shipping method option and a courier contract number field visible
I want to ensure a value is entered for the contract number, if (and only if) the prepaid shipping option is selected.
I have set up validation with spry validation text field, which works, but I only want the validation to trigger if my radio button value equates to prepaid shipping.
At the moment, the error will display whenever the field is empty
Is there an option not to trigger the validation if the field is hidden ?
*I also tried this using WA Client Validation, but on going through the wizard, I get the error shown..*