471,887 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

validate textbox

i have two radio button one yes and another no i want enable textbox only when the user select the yes button
Apr 12 '09 #1
3 1111
8,658 Expert Mod 8TB
put an onchange event on the yes button that displays/enables the textbox if the checked property is set to true.
Apr 12 '09 #2
i have this code but its let enable it if u press yes but it doesnt disable it back if user press no var currentEnabled = null;
Expand|Select|Wrap|Line Numbers
  1. function enableElement(elem) {
  2. if (currentEnabled) {
  3. currentEnabled.disabled = true;
  4. }
  5. elem.disabled = false;
  6. currentEnabled = elem;
  7. }
Apr 12 '09 #3
thanks for help my code its working
Apr 13 '09 #4

Post your reply

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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.