Forums

Conditional validation - possible?

sinemac 21 Sep, 2009
Is it possible to have the validation of a form field be conditional upon the value of a different field?

I've got a form that asks for email address and phone number, each as a textbox field.

I've got another question asking for their preferred method of contact - email or phone - as a radio button question.

I'd like to have the email field be 'required' at all times, but I want the phone field to only be required IF they select 'phone' as the preferred method of contact.

Is this possible with ChronoForms?

If yes - can you provide me with some hints to figure out how to do this?

Thanks,
Scott
GreyHead 23 Sep, 2009
Hi Scott,

Yes it's possible, it's another JavaScript exercise. You can use the MooTools addClass and removeClass to change the validation on the fly. There's been another thread on this in the last day or so.

Bob
This topic is locked and no more replies can be posted.