JavaScript and client side scripting.
Moderator: General Moderators
-
PHP_Ryan
- Forum Newbie
- Posts: 12
- Joined: Fri Apr 09, 2004 8:05 pm
Post
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
-
andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
Post
by andre_c »
try this
Code: Select all
onClick='window.top.location.href="document.myForm.myLinks.options[document.myForm.myLinks.selectedIndex].value"'
-
feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Post
by feyd »
Code: Select all
window.location.replace(document.myForm.myLinks.options[document.myForm.myLinks.selectedIndex].value);
fix old-new php highlighter
Last edited by
feyd on Fri Jan 13, 2006 8:06 pm, edited 1 time in total.
-
feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Post
by feyd »
that too.

-
PHP_Ryan
- Forum Newbie
- Posts: 12
- Joined: Fri Apr 09, 2004 8:05 pm
Post
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!