SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast chavodel8's Avatar
    Join Date
    Jun 2005
    Location
    Utah
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question PHP vs Javascript with a select box

    I'm hoping PHP will do this, but I may have to use Javascript. I have a select box and, upon someone choosing one of it's options, I want it to reload the same page with that option in the url:
    PHP Code:
    $_SERVER['PHP_SELF'] . "?opt=" $option_name
    kind of a thing. Any tips?
    Thanks,
    -el chavo

  2. #2
    SitePoint Guru enygmadae's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Tx.
    Posts
    795
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so what's wrong with that? looks fine to me...
    PHP News, Views and Community: http://www.phpdeveloper.org

  3. #3
    SitePoint Member bhinard's Avatar
    Join Date
    Jan 2005
    Location
    Caen
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you have to use the onchange() events into the select box
    a quick tutorial

  4. #4
    SitePoint Enthusiast chavodel8's Avatar
    Join Date
    Jun 2005
    Location
    Utah
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    No submit button

    The above code is what I want to put in, but I don't know where to put it. I don't want to have a submit button of any type - just the select box. Thus when an option in the select box is chosen, it immediately goes to that URL.
    I can put the above code in the form tag with action='above stuff', but I seem to still need the un-desired submit button. How can I skip that and immediately react to the select box choice?
    -el chavo

  5. #5
    SitePoint Enthusiast chavodel8's Avatar
    Join Date
    Jun 2005
    Location
    Utah
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bhinard
    you have to use the onchange() events into the select box
    a quick tutorial
    Ah, this is what I'm looking for. Thanks! I'll play with it a bit.
    -el chavo


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
  •