validate textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lolodede
    New Member
    • Apr 2009
    • 63

    validate textbox

    i have two radio button one yes and another no i want enable textbox only when the user select the yes button
    thanks
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    put an onchange event on the yes button that displays/enables the textbox if the checked property is set to true.

    Comment

    • lolodede
      New Member
      • Apr 2009
      • 63

      #3
      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;
      Code:
      function enableElement(elem) {
      if (currentEnabled) {
      currentEnabled.disabled = true;
      }
      elem.disabled = false;
      currentEnabled = elem;
      }
      Last edited by Dormilich; Apr 13 '09, 06:40 AM. Reason: please use code tags!

      Comment

      • lolodede
        New Member
        • Apr 2009
        • 63

        #4
        thanks for help my code its working

        Comment

        Working...