Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > On Change..

Reply
Thread Tools

On Change..

 
 
amatuer
Guest
Posts: n/a
 
      12-06-2006
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

 
Reply With Quote
 
 
 
 
Firas S Assaad
Guest
Posts: n/a
 
      12-06-2006
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


 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      12-06-2006

"amatuer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments