SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Oct 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Open new with option value?

    <option value="http://www.domain.com">Link Text</option>

    I have this code in an iframe and is being used for a drop down list... Now, when clicked it opens in the iframe, I want it to open in a new, blank window. So, I tried this:

    <option value="http://www.domain.com" target="_blank">Link Text</option>

    This didnt not work, in fact nothing happens at all with this.

    Can you tell me how to make this code open a new, blank window?

    Thanks!

  2. #2
    Maniacally depressed robot poncho's Avatar
    Join Date
    Dec 2004
    Location
    Belfast, N.Ireland
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this. I think this is what you are looking for...

    Code:
    <form name="myform" id="myform">
    <select name="mydropdown" id="mydropdown" onchange="window.open(this.options[this.selectedIndex].value);">
    	<option value="http://www.domain.com">domain.com</option>
    	<option value="http://www.example.com">example.com</option>
    </select>
    </form>
    Cheers;
    Poncho
    Perfecting the art of breaking stuff.
    Check 'em: CakePHP | TextMate


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •