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

Hide/show a text box based on drop down list in php

P: 63
HI..

I am looking for php code that will enable me to hide/show a text box based on the users previous drop down list response. If javascript comes into use for it,
its a welcome solution

(1) I want the "additional" text box to ONLY display if the user answers the drop down list with "yes"
(2) If the user answers "no" to the previous drop down list I don't want the "additional" text box displayed
(3) When the form is originally opened I dont want it to display the "additional" text box.

Reagards
TechnoAtif
Jan 11 '08 #1
Share this Question
Share on Google+
1 Reply


stepterr
100+
P: 157
HI..

I am looking for php code that will enable me to hide/show a text box based on the users previous drop down list response. If javascript comes into use for it,
its a welcome solution

(1) I want the "additional" text box to ONLY display if the user answers the drop down list with "yes"
(2) If the user answers "no" to the previous drop down list I don't want the "additional" text box displayed
(3) When the form is originally opened I dont want it to display the "additional" text box.

Reagards
TechnoAtif
If you were to do javascript just use an onchange event that will call the javascript function that will be used to evaluate what the user selected. Then depending on what they select just enable or disable the text box element by it's id. When the form is originally opened just default the text box to the disabled state.
Jan 20 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.