![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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=selOb j.value==2?'block':'none'; } if(selObj.value==1){ document.getElementById('foo').style.display=selOb j.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 |
#3
| |||
| |||
|
|
script type=="text/JavaScript" function Prit_jumpMenu(selObj){ //v3.0 if(document.getElementById){// check if browser supports the method document.getElementById('boo').style.display=selOb j.value==2?'block':'none'; document.getElementById('foo').style.display=selOb j.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=selOb j.value==2?'block':'none'; } if(selObj.value==1){ document.getElementById('foo').style.display=selOb j.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 |
#4
| |||
| |||
|
|
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 |
#5
| |||
| |||
|
| 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 |
#6
| |||
| |||
|
|
Mark that well, too! |
![]() |
| Thread Tools | |
| Display Modes | |
| |