I believe that would be possible with either the
required(dependency-expression) or required(dependency-callback) options

It looks really similar to the sample they use for dependency-expression
http://docs.jquery.com/Plugins/Validation/Methods/required#dependency-expres
sion 

Though if you're going to get more complicated you may want to use
dependency-callback
http://docs.jquery.com/Plugins/Validation/Methods/required#dependency-callba
ck 

Hope this helps,
Christine

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Josh Gillies
Sent: Sunday, November 09, 2008 7:38 PM
To: jQuery (English)
Subject: [jQuery] [validate] Dynamic required fields


Hey all,

I am wondering whether it's possible to set up a form with dynamic
required fields?

Basically what I am after is a feedback form with a question like

How would you rate this site?

with possible answers as

Great
Okay
Needs Work

to finish this up there will be a comment box which will default to
not required assuming the user will tick Great or Okay. But if they
say it needs work then I'd like to have the comments area switch to
required so to get them to leave comments as to why they think the
site needs work.

I hope you understand me request.

Thanks in advance :)


Reply via email to