| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read | ![]() |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
From a drop down on change it won't work if I use this script twice on one page: Code:
<script language="JavaScript">
<!--
function goToNextPage()
{
PageIndex=document.form_menu.My_Choice.selectedIndex
if (document.form_menu.My_Choice.options[PageIndex].value != "none")
{
location = document.form_menu.My_Choice.options[PageIndex].value
}
}
-->
</script>
<form name="form_menu">
<p><span style="font-size: 7pt"><font face="Verdana">Theme Selection:-<br>
<font face="Tahoma"><select name="My_Choice" size="1" onchange="goToNextPage()">
<option value="none" selected="selected">Select....</option>
<option value="http://link.com">1</option>
<option value="http://link.com">2</option>
</select></font> </font></span>
http://team-300.net/templates/2/300....e=themechanger with the two same scripts, this won't work When there's one of them, this will work :- http://team-300.net/templates/2/300.php?site=news |
|
|||
|
Hi karimali831,
I don't know a great deal about javascript but I think the solution is to change the name of the second script. e.g. function goToNextPage() function goToNextPage1() Of course, I might just be showing my ignorance of javascript and be miles off the mark. |
|
|||
|
Surely, you need to send a reference to which <SELECT> object you are referencing:
<select name="My_Choice" size="1" onchange="goToNextPage(this)"> .... function goToNextPage(oSelect) { PageIndex=oSelect.selectedIndex Hope this helps, Chris |
![]() |
| Thread Tools | |
| Display Modes | |
|
|