Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 04-04-08
Dazza30's Avatar
Registered User
 
Join Date: Mar 2006
Location: cheshire uk
Posts: 404
Thanks: 3
Thanked 0 Times in 0 Posts
Dazza30 is an unknown quantity at this point
  Opening a new window from an option tag

Please can some one please help?

I have a bog standard drop down menu on my index page, i need to be able to open the links in it in a new window.

I cant use target="_blank" because the option tag doesnt support it, is there another way to do it?
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-04-08
Registered User
 
Join Date: Feb 2006
Location: Gillingham
Posts: 502
Thanks: 0
Thanked 0 Times in 0 Posts
Donk is an unknown quantity at this point
  Re: Opening a new window from an option tag

You could use the form tag which does allow the target attribute.
HTML Code:
<form method="post" name="myform" action="newpage.php" target="_blank">
<select name="dropdown" onchange="myform.submit()">
<option>1</option>
<option>2</option>
</select>
</form>
__________________
They came for my 404 and I said nothing
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-04-08
Dazza30's Avatar
Registered User
 
Join Date: Mar 2006
Location: cheshire uk
Posts: 404
Thanks: 3
Thanked 0 Times in 0 Posts
Dazza30 is an unknown quantity at this point
  Re: Opening a new window from an option tag

Quote:
Originally Posted by Donk View Post
You could use the form tag which does allow the target attribute.
HTML Code:
<form method="post" name="myform" action="newpage.php" target="_blank">
<select name="dropdown" onchange="myform.submit()">
<option>1</option>
<option>2</option>
</select>
</form>
I dont currently use php so how does the newpage.php work?
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-04-08
Registered User
 
Join Date: Jun 2006
Posts: 163
Thanks: 0
Thanked 1 Time in 1 Post
jonsp is an unknown quantity at this point
  Re: Opening a new window from an option tag

Hi,
something like this
<select onchange="window.open(this.options[this.options.selectedIndex].value);">
<option value="http://google.com">Google</option>
<option value="http://msn.com">MSN</option>
</select>


Cheers,
Jon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-04-08
Registered User
 
Join Date: Feb 2006
Location: Gillingham
Posts: 502
Thanks: 0
Thanked 0 Times in 0 Posts
Donk is an unknown quantity at this point
  Re: Opening a new window from an option tag

If your not using PHP I would stick with jonsp's solution but for the record the php code newpage.php could look something like this:


PHP Code:
Your html head and start of your page
<?php
if ($_POST['dropdown']==1){
?>
your html for option 1
<?
}
else if  (
$_POST['dropdown']==2){
?>
your html for option 2
<?php ?>
more html
__________________
They came for my 404 and I said nothing
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-04-08
Dazza30's Avatar
Registered User
 
Join Date: Mar 2006
Location: cheshire uk
Posts: 404
Thanks: 3
Thanked 0 Times in 0 Posts
Dazza30 is an unknown quantity at this point
  Re: Opening a new window from an option tag

Thanks for the input Donk, im going to read a book next week called teach yourself php in 24 hours hopefully it will be of some use.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-04-08
Dazza30's Avatar
Registered User
 
Join Date: Mar 2006
Location: cheshire uk
Posts: 404
Thanks: 3
Thanked 0 Times in 0 Posts
Dazza30 is an unknown quantity at this point
  Re: Opening a new window from an option tag

Quote:
Originally Posted by jonsp View Post
Hi,
something like this
<select onchange="window.open(this.options[this.options.selectedIndex].value);">
<option value="http://google.com">Google</option>
<option value="http://msn.com">MSN</option>
</select>


Cheers,
Jon
Thanks a lot jonsp, hopefully this is the answer.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Masking url and opening in a new window rammy786 The Affiliate Marketing Lounge 3 04-11-07 11:10 PM
Site is blank page in Internet Explorer warren_p The Affiliate Marketing Lounge 12 28-06-07 11:10 AM
Price Reduction for BT Total Broadband Option 3 JenB DGM Affiliates 0 01-05-07 11:41 AM
Opening a sign up window Greedo Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 2 22-03-06 12:54 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7