| Author |
Select Menu Javascript Question Hidden/Visible areas
|
|
|
| Hi
Earlier I had asked the a javascript question but did not get an answer
(Murray did try to help me though.)and I have managed to get it working
though not fully well. Here is the code for the page. The problem is that
once i select a different number on the drop down the earlier selection
should be replace. It does not do it now. It remains in place. I hope
someone can figure it out.
thanks in advance
Prit
<script language="JavaScript">
<!--
function MM_jumpMenu(selObj){ //v3.0
if (selObj.value==2){
document.getElementById('boo').style.display=selObj.value==2?'block':'none';
}
if(selObj.value==1){
document.getElementById('foo').style.display=selObj.value==1?'block':'none';
}
}
//-->
</script>
<body>
<form>
<select name="dropdown" size="1" onchange="MM_jumpMenu(this)">
<option>Select</option>
<option value="1">1</option>
<option Value="2">2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<table>
<tr id="boo" style="display:none;">
<td>New text field:</td>
<td><input name="newField" type="text" size="20"></td>
</tr>
<tr id="foo" style="display:none;">
<td>New text field:</td>
<td><input name="newField2" type="text" size="2"></td>
</tr>
</table>
</form>
</body>
</html>
| |
| Mick White 2004-08-26, 12:22 pm |
| <script type=="text/JavaScript">
function Prit_jumpMenu(selObj){ //v3.0
if(document.getElementById){// check if browser supports the method
document.getElementById('boo').style.display=selObj.value==2?'block':'none';
document.getElementById('foo').style.display=selObj.value==1?'block':'none';
}
}
</script>
And if you modify MM's functions, you should at least remove the MM prefix.
Mick
Prit wrote:
> Hi
> Earlier I had asked the a javascript question but did not get an answer
> (Murray did try to help me though.)and I have managed to get it working
> though not fully well. Here is the code for the page. The problem is that
> once i select a different number on the drop down the earlier selection
> should be replace. It does not do it now. It remains in place. I hope
> someone can figure it out.
> thanks in advance
> Prit
>
> <script language="JavaScript">
> <!--
> function MM_jumpMenu(selObj){ //v3.0
> if (selObj.value==2){
> document.getElementById('boo').style.display=selObj.value==2?'block':'none';
> }
> if(selObj.value==1){
> document.getElementById('foo').style.display=selObj.value==1?'block':'none';
> }
> }
>
> //-->
> </script>
> <body>
> <form>
> <select name="dropdown" size="1" onchange="MM_jumpMenu(this)">
>
> <option>Select</option>
> <option value="1">1</option>
> <option Value="2">2</option>
> <option>3</option>
> <option>4</option>
> <option>5</option>
> </select>
> <table>
> <tr id="boo" style="display:none;">
> <td>New text field:</td>
> <td><input name="newField" type="text" size="20"></td>
> </tr>
> <tr id="foo" style="display:none;">
> <td>New text field:</td>
> <td><input name="newField2" type="text" size="2"></td>
> </tr>
> </table>
> </form>
>
> </body>
> </html>
>
>
| |
|
| Mark
It worked great ....thank you so much.. I greatly appreciate your help.
I will keep ur suggestion in mind... about the name change
Prit
"Mick White" <mwhite13@BOGUSrochester.rr.com> wrote in message
news:cgjiba$cg5$1@forums.macromedia.com...
> <script type=="text/JavaScript">
>
> function Prit_jumpMenu(selObj){ //v3.0
> if(document.getElementById){// check if browser supports the method
>
document.getElementById('boo').style.display=selObj.value==2?'block':'none';
>
document.getElementById('foo').style.display=selObj.value==1?'block':'none';
> }
> }
>
> </script>
> And if you modify MM's functions, you should at least remove the MM
prefix.[color=darkred]
>
> Mick
>
> Prit wrote:
that[color=darkred]
document.getElementById('boo').style.display=selObj.value==2?'block':'none';[color=darkred]
document.getElementById('foo').style.display=selObj.value==1?'block':'none';[color=darkred]
| |
|
|
| Mick White 2004-08-26, 11:15 pm |
|
Prit wrote:
> Mark
> It worked great ....thank you so much.. I greatly appreciate your help.
> I will keep ur suggestion in mind... about the name change
> Prit
You don't have to change my name, though.
Mick
|
|
|
|
| Copyright 2003 - 2009 forum4designers.com Software forum Computer Hardware reviews |