Web Analytics Made Easy -
StatCounter Preserving <select> option value after submitting the form - CodingForum

Announcement

Collapse
No announcement yet.

Preserving <select> option value after submitting the form

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Preserving <select> option value after submitting the form

    Hello again everybody

    Does someone know by any chance how to make the <select> field to preserve the option value -- that was selected by the user -- after the form is submitted? So that the user could see after submitting the form what option they've chosen...

    Thank you in advance for your help,
    Have an excellent day

  • #2
    Do you mean to keep that field selected or what?
    I lost my signature, have you seen it?
    I have the power to erase you...

    Comment


    • #3
      Yeah, that's what i mean - to keep the field selected after the form's submitted

      Comment


      • #4
        I fiddled with this on a game ranks page I made... and I came up with

        <option value="Level" <? if(isset($_GET['filter'])){ if ($_GET['filter'] == 'Level'){ echo "selected"; }}?>>Level</option>

        I'm sure there's better ways but that works

        Comment


        • #5
          Thank you, BaDgEr

          Comment

          Working...
          X