disabling textbox with javascript..

Discussion in 'JavaScript' started by sercan, Nov 12, 2008.

  1. #1
    hi guys,

    i have a very simple form but as i am newbie on Java Script i couldn't solve one problem..

    i want my textbox to be enabled (it is disabled by default) if the user US from the combo box above it.. but, if the user choose a different contry i want my textbox to stay disabled as default.. here is my code:

    where is the problem or am i missing something?
     
    sercan, Nov 12, 2008 IP
  2. ferdousx

    ferdousx Peon

    Messages:
    168
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use a function like this:

    function disableit{
    document.formname.textfieldname.disabled=true;
    }

    and call it like this inside select: onchange="disableit()"

    Its not the exact code, but it should be like this.
     
    ferdousx, Nov 12, 2008 IP
  3. sercan

    sercan Well-Known Member

    Messages:
    204
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #3
    thanks for your interest, i fixed it :)
     
    sercan, Nov 12, 2008 IP