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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2008
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    combobox question

    using your handy tutorial, i built a combox (see below), my question is why do these links not open in a new window? well really, the question is how do I get them to open in a new window?
    Any direction much appreaciated,

    Michele

    <form name="lookup">
    <p><select name="example" size="1">
    <option value="http://www.allergyfoundation.ca" target="_blank">Allergies</option>
    <option value="http://www.arthritis.ca" target="_blank">Arthritis</option>
    <option value="http://www.asthma.ca" target="_blank">Asthma</option>
    <option value="http://www.cancer.ca" target="_blank">Cancer</option>
    <option value="http://www.cps.ca" target="_blank">Childrens Health</option>
    <option value="http://www.echn.ca" target="_blank">- Online forum</option>
    <option value="http://www.canadian-health-network.ca" target="_blank">Complementary Medicine</option>
    <option value="http://www.diabetes.ca" target="_blank">Diabetes</option>
    <option value="http://www.cfas.ca" target="_blank">Fertility</option>
    <option value="http://www.iaac.ca" target="_blank">Fertility</option>
    <option value="http://www.infertilitynetwork.org" target="_blank">Infertility Network</option>
    <option value="http://www.heartandstroke.ca" target="_blank">Heart Health</option>
    <option value="http://www.infectnet.com" target="_blank">Infections & Antibiotics</option>
    <option value="http://lung.ca" target="_blank">Lung & Respiratory</option>
    <option value="http://www.sogc.org" target="_blank">Menopause</option>
    <option value="http://www.cmha.ca" target="_blank">Mental Health</option>
    <option value="http://www.motherisk.org" target="_blank">Pregnancy</option>
    <option value="http://www.sexualityandu.ca" target="_blank">Sexuality</option>
    <option value="http://www.dermatology.ca" target="_blank">Skin Concerns</option>
    <option valuef="http://www.strokerecoverycanada.com" target="_blank">Stroke Recovery</option>
    <option value="http://www.continence-fdn.ca" target="_blank"><u>Urinary Health</option>
    <option value="http://www.cwhn.ca" target="_blank">Womens Health</option>
    <option value="http://www.womenshealthmatters.ca" target="_new">Womenshealthmatters.ca</option>
    </select></p>

    <script language="javascript">
    <!--
    function go()
    {
    location=document.lookup.example.
    options[document.lookup.example.selectedIndex].value
    }
    //-->
    </script>

    <input type="button" name="test" value="Go!" onClick="go()">
    </form>

  • #2
    Regular Coder mjlorbet's Avatar
    Join Date
    Jan 2008
    Location
    Milwaukee, WI
    Posts
    724
    Thanks
    8
    Thanked 96 Times in 95 Posts
    Code:
     
    <script language="javascript">
    <!--
    function go()
    {
    window.open(document.lookup.example.
    options[document.lookup.example.selectedIndex].value);
    }
    //-->
    </script>
    please post your code in between code tags, it's the # sign in the editor
    -Mike
    "Want me to precludify him, like some kind of dispatcherator?... Can do!" -Bender

  • Users who have thanked mjlorbet for this post:

    minglis (04-28-2008)


  •  

    Posting Permissions

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