By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,002 Members | 2,157 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,002 IT Pros & Developers. It's quick & easy.

Complex server-side rules with QuickForm

P: n/a
Hi All,

I am wanting to do "complex" server-side JS validation. I put "complex" in
quotes because complex is of course in the eye of the beholder.

What I would like to do is actually fairly simple in theory. We have a drop
down box, and a text box. We ask the user for their favorite color, and the
options in the drop down box are red, green, blue, or other. If they choose
red, green, or blue, then the text box is grayed out (disabled='disabled'
attribute is set for the <input> tag). If they choose other, then the text
box becomes available for them to input their favorite color in.

Is there a way to do this with QuickForm without resorting to hand-coding
all the JS? I have a vague sense that I once saw a tutorial on how to do
this, but I've been googling for it and not been able to turn anything up.
I would be very grateful for any tips!

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
I am not familiar with QuickForms but it sounds like you require a
JavaScript solution.

This would then be a client side action. If you are trying to avoid
using a scripting language then I am not sure if it is possible the way
you describe.

You could get them to choose and submit and check if it is other, and
if so on the next page ask them for input as to what it is.

Alternatively you could give them an enabled <input> text box in case
they choose other and only read this value if they have chosen other.
Else just use the value in the drop down menu.

Hope this is clear for you and that it helps.

Jul 17 '05 #2

P: n/a
I said server side when I meant client side - obviously the JS for this
needs to be client side.
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.