cinq
03-09-2005, 07:24 AM
I am trying to place this auto redirect select dropdown box on the postbits of all member.
The code:
<Script language="JavaScript">
<!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development
function goto(form) { var index=form.select.selectedIndex
if (form.select.options[index].value != "0") {
location=form.select.options[index].value;}}
//-->
</SCRIPT>
<FORM NAME="form1">
<SELECT NAME="select" ONCHANGE="goto(this.form)" SIZE="1">
<OPTION VALUE="$vboptions[bburl]/index.php">Home
<OPTION VALUE="$vboptions[bburl]/usercp.php">Control Panel
</SELECT>
</FORM>
used code from here (http://www.web-source.net/javascript_redirect_box.htm)
Once there, all a user has to do is select the appropriate item in the dropdown, say "Control Panel" and it will automatically redirect to the usercp.php page.
However it doesn't seem to redirect. Anyone, any ideas why this doesn't work ? :(
Edit : hmm odd, it works on IE it seems but not on Firefox.
Is there any way around it so that it works on all browsers ?
Ok nvm...ended up using this code and it seems to work :
<SELECT name="select" ONCHANGE="window.location=(this.options[selectedIndex].value);" SIZE="1">
The code:
<Script language="JavaScript">
<!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development
function goto(form) { var index=form.select.selectedIndex
if (form.select.options[index].value != "0") {
location=form.select.options[index].value;}}
//-->
</SCRIPT>
<FORM NAME="form1">
<SELECT NAME="select" ONCHANGE="goto(this.form)" SIZE="1">
<OPTION VALUE="$vboptions[bburl]/index.php">Home
<OPTION VALUE="$vboptions[bburl]/usercp.php">Control Panel
</SELECT>
</FORM>
used code from here (http://www.web-source.net/javascript_redirect_box.htm)
Once there, all a user has to do is select the appropriate item in the dropdown, say "Control Panel" and it will automatically redirect to the usercp.php page.
However it doesn't seem to redirect. Anyone, any ideas why this doesn't work ? :(
Edit : hmm odd, it works on IE it seems but not on Firefox.
Is there any way around it so that it works on all browsers ?
Ok nvm...ended up using this code and it seems to work :
<SELECT name="select" ONCHANGE="window.location=(this.options[selectedIndex].value);" SIZE="1">