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 Coder
    Join Date
    Jul 2003
    Location
    Louisiana
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Keeping selected text displayed upon reloading the page?

    Can someone please tell me how to keep the selected text in the drop down menus after the page reloads? It seems to work for the first selection, however not the second.

    http://72.34.48.97/~tswtold/quote/test_dropdown.php

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    This is more of a PHP question - you just insert the attribute selected as you are doing on the first dropdown based on the passed sel2/sel3 querystring. You can do it in Javascript but since you are using PHP, then it's better to do it there.

    BTW, you don't have to manually generate the url to submit the page to. You can just set the form method to "get" and action to "test_dropdown.php" and then in the onchange of each select, do this.form.submit()

  • #3
    New Coder
    Join Date
    Jul 2003
    Location
    Louisiana
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Go it thanks.

    Jeremy


  •  

    Posting Permissions

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