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 10 of 10
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    161
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Dropdown without Go Button

    I would prefer to use PHP over Javascript but I don't know if what I want to do is possible with PHP or how to do it if it is, what I want is a dropdown and when you select an option from it, you are automatically taken to another page (no button to click) is that possible without JS?

  • #2
    New to the CF scene
    Join Date
    Feb 2003
    Location
    delhi
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no i dont think it ispossible with out javascript. But by using javascript your object has been solved , onchange event of select , is used in that case. If u get the way without useingjavascript then plz let me know.

  • #3
    New Coder
    Join Date
    Feb 2003
    Location
    Toronto, ON
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts
    anurag_shr is right. PHP is a server-side language, what you're describing is a client-side behaviour. Once the page is loaded in your browser, forget PHP. It's simple enough to do with JS using the onChange method as mentioned.

    Cheers.
    Thodyconsulting.com

  • #4
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    This belongs in the Javascript forum....

    Ding Ding...
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    An example is on this very page:

    Code:
    <select name="forumid" 
    onchange="window.location=('forumdisplay.php?s=&daysprune=&forumid='+this.options[this.selectedIndex].value)">
    		<option value="-1" >Please select one:</option>
    		<option value="-1">--------------------</option>
    		<option value="pm" >Private Messages</option>
    		<option value="cp" >User Control Panel</option>
    <!-- and so on -->
    </select>

  • #6
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    still not actually using PHP, just refering to the page ...

  • #7
    Registered User
    Join Date
    Feb 2003
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Its still in the PHP Forum

    Ding Ding...

  • #8
    Registered User
    Join Date
    Feb 2003
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well there is still a link to it in the PHP Forum

    Dong Dong

  • #9
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Well of course it's still linked in the PHP forum

    Ding Dong

    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #10
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Jesh, what i meant was the code supplied above wasnt PHP.
    If that's even what you were talking about.


  •  

    Posting Permissions

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