For Programmers: Free Programming Magazines  


Home > Archive > ASP > December 2006 > On Change..









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author On Change..
amatuer

2006-12-06, 3:55 am

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

2006-12-11, 6:57 pm

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="java script: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


Mike Brind

2006-12-11, 6:57 pm


"amatuer" <njoosub@gmail.com> wrote in message
news:1165392004.906858.70960@79g2000cws.googlegroups.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


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com