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 5 of 5

Thread: drop down box..

  1. #1
    New Coder
    Join Date
    Feb 2005
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    drop down box..

    Hello,

    I need to put the following link into a drop down box, so when the item is selected in the box it the link is called and the page is opened.

    <a href="qxl.php?action=sort_price&query='.$query.'&price=ASC">

    Pls could someone show me how i would do this ???

    Thxs.
    -----------------------------------------------

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    try this
    Code:
    <select onchange="window.open(this.options[this.selectedIndex].value);">
    <option value="" selected>Select an Option</option>
    <option value="qxl.php?action=sort_price&query='.$query.'&price=ASC">Option 1</option>
    </select>

  • #3
    New Coder
    Join Date
    Feb 2005
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That works a treat,

    But how do i open the link in the same window, rather than opening a new window ????

    Thxs.
    -----------------------------------------------

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    like this
    Code:
    <select onchange="window.location=this.options[this.selectedIndex].value;">
    <option value="" selected>Select an Option</option>
    <option value="qxl.php?action=sort_price&query='.$query.'&price=ASC">Option 1</option>
    </select>

  • #5
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    BTW, this little blurb about accessible forms might be worth noting.

    Actually, that's not entirely true--as I recall, the control can be dropped up/down with a key sequence (but this may be a system dependent setting).
    Last edited by codegoboom; 02-25-2005 at 02:39 AM.
    *this message will self destruct in n-seconds*


  •  

    Posting Permissions

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