Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Pls Help
Topic Started: Oct 16 2009, 10:23 PM (147 Views)
sgtog
Member
 *   *  
Hi, i am using this drop-down list box code for my forum but members find it frustrating as it doesn't open up a new window.
I would appreciate if someone can help me with this code to make it open a new window when its click.

Code:
 
<form><select name=select size="1" style="background-color:#333333; font size:8pt; font-family:verdana;color:#98AFC7"
onchange="location.href=(form.select.options[form.select.selectedIndex].value)">
<option value="">Search Engine</option>
<option value="http://www.google.com.sg/">Google Search</option>
<option value="http://search.yahoo.com/">Yahoo Search</option>
</select></form>


Thanks in advance

http://z12.invisionfree.com/SGTOG/index.php?act=idx
Edited by sgtog, Oct 17 2009, 12:34 AM.
Offline Profile Quote Post Goto Top
 
Codes Rock
Member Avatar
<?php echo 'Codes Rock rocks!'; ?>
 *   *   *  
You have to add target="_blank" to your form tag:

Code: HTML
 

<form target="_blank">
Offline Profile Quote Post Goto Top
 
sgtog
Member
 *   *  
Bro Codes Rock, where do i put this code,
Code: HTML
 

<form target="_blank">
appreciate your kind advice.

i'm currently using this code with the target="_blank" but dun seem to work.
Can kindly help advise me? This is the code i am using but not opening a new window.

Code:
 
<form><select name=select size="1" style="background-color:#333333; font size:8pt; font-family:verdana;color:#98AFC7"
onchange="location.href=(form.select.options[form.select.selectedIndex].value)">
<option value="">Search Engine</option>
<option value="http://www.google.com.sg/" target="_blank">Google Search</option>
<option value="http://search.yahoo.com/" target="_blank">Yahoo Search</option>
</select></form>


Thanks
Edited by sgtog, Oct 22 2009, 02:02 PM.
Offline Profile Quote Post Goto Top
 
Codes Rock
Member Avatar
<?php echo 'Codes Rock rocks!'; ?>
 *   *   *  
Use this:

Code: HTML
 

<form>
<select onchange="window.open(options[selectedIndex].value);" name="gourl" size="1" style="background-color:#333333; font size:8pt; font-family:verdana;color:#98AFC7" target="_blank">
<option value="">Search Engine</option>
<option value=
"http://www.google.com.sg/">Google Search</option>
<option value="http://search.yahoo.com/">Yahoo Search</option>
</select></form>
Offline Profile Quote Post Goto Top
 
sgtog
Member
 *   *  
Thanks Bro Codes Rock, its works!

Thanks bro!
Offline Profile Quote Post Goto Top
 
Codes Rock
Member Avatar
<?php echo 'Codes Rock rocks!'; ?>
 *   *   *  
No problem, glad to be able to help out.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Coding Support · Next Topic »
Add Reply