On Change..

A

amatuer

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
 
F

Firas S Assaad

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
 
M

Mike Brind

amatuer said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top