Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2006
    Location
    In the middle of a cornfield Illinois
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Opening This Combo box link in new window

    Ok here is the thing I am using this javascript to add items to our customers shopping cart, and the page that it is displayed on is an Iframe and I need these links to open in a new window.

    Code:
     
    
    <form name="linkform">
    <select name="links" size="1">
    <option value="http://ww6.aitsafe.com/cf/add.cfm?userid=82169076&product=test1&price=1&hash=9328533fa3a386472a62e92c068c6391" >test1</option>
    <option value="http://ww6.aitsafe.com/cf/add.cfm?userid=82169076&product=test2&price=2&hash=ea3084417d5484cb56f7061254c1faf4" >test2</option>
    <option value="http://ww6.aitsafe.com/cf/add.cfm?userid=82169076&product=test3&price=3&hash=27b5e331e43756a37f28b36d6f00705b" >test3</option>
    <option value="http://ww6.aitsafe.com/cf/add.cfm?userid=82169076&product=test4&price=4&hash=a2babf4a334d64cfc06954feece2485e" >test4</option>
    
    </select>
    
    <script language="javascript">
    <!--
    
    
    
    function openWindow()
    
    {
    location=
    document.linkform.links.options[document.linkform.links.selectedIndex].value
    
    }
    //-->
    </script>
    <a href="JavaScript:openWindow()">
    <img src="images/buynow_button.gif" border=0 width="100" height="32"></a>
    </form>
    But I cant seem to get a grasp on how to get it to open in a new window, if anyone can help that would be great.

    Thank You,
    Danyl

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    have you tried to use window.open(TheUrlHere)?

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New to the CF scene
    Join Date
    Oct 2006
    Location
    In the middle of a cornfield Illinois
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how would I get each link on my drop down box to go to there desinated location?
    Last edited by Danyl; 10-19-2006 at 05:06 PM.


  •  

    Posting Permissions

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