Selecting combo item should enable/disable the text box

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mana_panigrahi
Forum Newbie
Posts: 10
Joined: Fri May 08, 2009 8:22 am

Selecting combo item should enable/disable the text box

Post by mana_panigrahi »

Hi All,
I am fresh to PHP.
I am trying to play with combobox and text field on same page.
Combo box has 'yes' and 'no' options.If 'yes' option is sected the text field should be enabled on same page and if 'no' option is is selected the text field should be disabled.

I should not submit the page by a button click to enable/disable the text field.It should happen only with selection.

If any body has any idea or code to share please help!!!

Regards,
-Manoranjan
User avatar
turbolemon
Forum Commoner
Posts: 70
Joined: Tue Jul 14, 2009 6:45 am
Location: Preston, UK

Re: Selecting combo item should enable/disable the text box

Post by turbolemon »

Your asking in the wrong place. What you are asking is a client-side scripting question (i.e. JavaScript). Its easy though, you need to add an onchange event to the select element which toggles the disabled attribute on the textarea/input field.
Post Reply