On Change..

Discussion in 'ASP General' started by amatuer, Dec 6, 2006.

  1. amatuer

    amatuer Guest

    Hi, can anyone help me? I am trying to make an input box not visible or
    readonly when a slect box above is changed. Here's my code:

    <select name=selStake style="Width: 146px;">
    <option value="Mentor">Mentor</option>
    <option value="Institution">Institution</option>
    <option value="None">None</option></select>

    And i would like to make this box invisible or readonly when the above
    selct box is changed to "None" :

    <INPUT name=InstName>

    Any ideas or suggestion will be highly appreciated.Thanks
    amatuer, Dec 6, 2006
    #1
    1. Advertising

  2. Hi there,
    here is the code:
    the box will be enabled at start point, but when the dropdown box is
    changed to whatever or to None, it will disable the box, right?

    <script>
    function doit()
    {
    if(window.form1.selStake.value=="None")
    {
    window.form1.InstName.disabled=true;
    }
    else
    {
    window.form1.InstName.disabled=true;
    }
    }
    </script>


    <form name="form1">
    <select name=selStake style="Width: 146px;"
    onchange="javascript:doit();">
    <option value="Mentor">Mentor</option>
    <option value="Institution">Institution</option>
    <option value="None">None</option>
    </select>

    <input type="text" name="InstName">
    </form>



    hope this helps


    Best Regards
    Firas S Assaad
    amatuer wrote:
    > Hi, can anyone help me? I am trying to make an input box not visible or
    > readonly when a slect box above is changed. Here's my code:
    >
    > <select name=selStake style="Width: 146px;">
    > <option value="Mentor">Mentor</option>
    > <option value="Institution">Institution</option>
    > <option value="None">None</option></select>
    >
    > And i would like to make this box invisible or readonly when the above
    > selct box is changed to "None" :
    >
    > <INPUT name=InstName>
    >
    > Any ideas or suggestion will be highly appreciated.Thanks
    Firas S Assaad, Dec 6, 2006
    #2
    1. Advertising

  3. amatuer

    Mike Brind Guest

    "amatuer" <> wrote in message
    news:...
    > Hi, can anyone help me? I am trying to make an input box not visible or
    > readonly when a slect box above is changed. Here's my code:
    >
    > <select name=selStake style="Width: 146px;">
    > <option value="Mentor">Mentor</option>
    > <option value="Institution">Institution</option>
    > <option value="None">None</option></select>
    >
    > And i would like to make this box invisible or readonly when the above
    > selct box is changed to "None" :
    >
    > <INPUT name=InstName>
    >
    > Any ideas or suggestion will be highly appreciated.Thanks
    >


    You are more likely to get help with this from a client-side scripting
    group, such as microsoft.public.scripting.jscript

    --
    Mike Brind
    Mike Brind, Dec 6, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Q. John Chen
    Replies:
    0
    Views:
    347
    Q. John Chen
    Nov 15, 2006
  2. Q. John Chen
    Replies:
    0
    Views:
    307
    Q. John Chen
    Nov 15, 2006
  3. Suganya
    Replies:
    0
    Views:
    446
    Suganya
    Apr 29, 2008
  4. Hemant

    Change Framework 3.5 to 2.0 change

    Hemant, Nov 13, 2009, in forum: ASP .Net
    Replies:
    5
    Views:
    1,695
    Digvijay Singh
    Nov 16, 2009
  5. tom c
    Replies:
    1
    Views:
    202
    PeterKellner
    Jun 8, 2006
Loading...

Share This Page