SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist Fleeters's Avatar
    Join Date
    Jul 2003
    Location
    Dumpsville
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    redirect from select box

    how can i redirect from a selection box without a submit button. I was using this:

    <select name='category' onChange='this.document.location=this.value;'>
    <option value='1'>Select Category</option>
    <option value='2'>All</option>
    </select>

    but it doesnt work in firefox / camino / mozilla.

    thanks..
    Aaron Smith
    smithaaronlee.net

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Code:
    <select name="category" onchange="location=this.options[this.selectedIndex].value">
    However, you should definitely have some sort of backup navigation for those with Javascript disabled. Maybe hide the submit button with Javascript on page load.


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
  •