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
    Jul 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    noob needs help, select menu, onchange, windows

    hello people

    got a small problem

    ive managed to get this peice of code to work to go to a different page when a user selects a certain object,

    heres the code

    Code:
        <select name="option"  onchange='window.open(this.value,"_self")'>
     <option value="SELECT">SELECT</option>
    <option value="view.php?id=$id">View</option>
    <option value="edit.php?id=$id">Edit</option>
     <option value="print.php?id=$id">Print</option>
    <option value="parcellabel.php?id=$id&q=insurance&e=true">Insurance     </option>
      <option value="parcellabel.php?id=$id&q=warranty">Warranty</option>
    </select>
    this works great but i got the application im building looked at by someone and they said that they want the last 2 options to open in a new window (the links i have put in there end up at a pdf document which is made by the server

    is there anyway i can modify this to open the last 2 links in a new window? thanks adam

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Try:

    onchange='if(this.selectedIndex<4){window.open(this.value,"_self")}else{window.open(this.value,"_bla nk")}'

    or

    onchange='function(){if(this.selectedIndex<4){window.open(this.value,"_self")}else{window.open(this. value,"_blank")}}'
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you!!

    the first one worked a treat!


  •  

    Posting Permissions

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