This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > Select Menu Javascript Question Hidden/Visible areas





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 Select Menu Javascript Question Hidden/Visible areas
Prit

2004-08-26, 12:21 pm

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>
>
>

Prit

2004-08-26, 7:15 pm

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]


Murray *TMM*

2004-08-26, 11:15 pm

Mark that well, too!

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Mick White" <mwhite13@BOGUSrochester.rr.com> wrote in message
news:cglr99$svv$2@forums.macromedia.com...
>
>
> Prit wrote:
>
>
> You don't have to change my name, though.
> Mick



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
Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews