hazel
09-03-2003, 07:56 AM
Below is a code which works fine. However I want to put more than one of these drop down menus on a page and it would appear that it only works with one script. Does anyone know of any way I can alter the script to take more than one drop down menu on a page please ?
<script language="javascript" type="text/javascript">
function go()
{
if (document.selecter.select1.options[document.selecter.select1.selectedIndex].value != "none")
{
location = document.selecter.select1.options[document.selecter.select1.selectedIndex].value
}
}
</script>
<script language="JavaScript" type="text/javascript">
document.write('<form name="selecter"><select name="select1">');
document.write('<option value="france.html">France</option>');
document.write('<option value="ireland.html">Ireland</option>');
document.write('<option value=""></option>');
document.write('<option value=""></option>');
document.write('<option value=""></option>');
document.write('</select>');
document.write('<input type="button" value="Go" onclick="go()">');
document.write('</form>');
</script>
<script language="javascript" type="text/javascript">
function go()
{
if (document.selecter.select1.options[document.selecter.select1.selectedIndex].value != "none")
{
location = document.selecter.select1.options[document.selecter.select1.selectedIndex].value
}
}
</script>
<script language="JavaScript" type="text/javascript">
document.write('<form name="selecter"><select name="select1">');
document.write('<option value="france.html">France</option>');
document.write('<option value="ireland.html">Ireland</option>');
document.write('<option value=""></option>');
document.write('<option value=""></option>');
document.write('<option value=""></option>');
document.write('</select>');
document.write('<input type="button" value="Go" onclick="go()">');
document.write('</form>');
</script>