Dynamic enabling/disabling of form elements?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TheKeith

    #1

    Dynamic enabling/disabling of form elements?

    I'm currently working on a form for my site and would like to do something
    that I've seen many times on other sites. I would like to make a particular
    form element enabled or disabled depending on whether another requisite form
    radio button is checked.

    I tried this:

    <input type="radio" name="yesorno" id="yes"
    onClick="docume nt.getElementBy Id('metoo').dis abled = 'false';">
    <br>
    <input type="checkbox" id="metoo" disabled="true" >
    <br>
    <br>
    <input type="radio" name="yesorno" id="no">


    but it doesn't work--I can't figure out why. Can someone help? Thanks.


  • TheKeith

    #2
    Re: Dynamic enabling/disabling of form elements?

    Ahh, nevermind I figured it out. You don't need the quotes around the false
    because it isn't a string.




    "TheKeith" <no@spam.com> wrote in message
    news:x-SdnTmsJIBcQUWi4 p2dnA@giganews. com...[color=blue]
    > I'm currently working on a form for my site and would like to do something
    > that I've seen many times on other sites. I would like to make a[/color]
    particular[color=blue]
    > form element enabled or disabled depending on whether another requisite[/color]
    form[color=blue]
    > radio button is checked.
    >
    > I tried this:
    >
    > <input type="radio" name="yesorno" id="yes"
    > onClick="docume nt.getElementBy Id('metoo').dis abled = 'false';">
    > <br>
    > <input type="checkbox" id="metoo" disabled="true" >
    > <br>
    > <br>
    > <input type="radio" name="yesorno" id="no">
    >
    >
    > but it doesn't work--I can't figure out why. Can someone help? Thanks.
    >
    >[/color]


    Comment

    Working...