Page 1 of 1

Submit Button Problem

Posted: Mon Apr 12, 2004 5:07 pm
by PHP_Ryan
OK...I have a php/javascript driven dependant select menu finally working. My problem is the submit button looks like this:

Code: Select all

<input type="button" value="Search!" onClick=window.open(document.myForm.myLinks.options[document.myForm.myLinks.selectedIndex].value) class="inputsbtn">
I need it to display in the current browser window, not open a new one as it currently does.

Thanks for the help! - Ryan

Posted: Mon Apr 12, 2004 5:23 pm
by andre_c
try this

Code: Select all

onClick='window.top.location.href="document.myForm.myLinks.options[document.myForm.myLinks.selectedIndex].value"'

Posted: Mon Apr 12, 2004 5:24 pm
by feyd

Code: Select all

window.location.replace(document.myForm.myLinks.options[document.myForm.myLinks.selectedIndex].value);
fix old-new php highlighter

Posted: Mon Apr 12, 2004 5:25 pm
by feyd
that too. :)

Posted: Mon Apr 12, 2004 8:03 pm
by PHP_Ryan
Woohoo...got it. I mixed a little of both replies together:

Code: Select all

onClick=window.top.location.href(document.myForm.myLinks.options[document.myForm.myLinks.selectedIndex].value);
Thanks again!

p.s. Feyd...once again, you pulled me through another one!