SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict hiddenpearls's Avatar
    Join Date
    Dec 2007
    Location
    Pakistan
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    strange drop down box behavior

    hey guys,

    I got a very strange behavior of drop down box and tried to fix a lot but couldn't. So, I am posting here now.

    I have a list of options in drop down and also have set a selected option there.
    when i select any other option and refresh the page (not submit form) it preserves my selected option currently in drop down. whether it should selected that option in which i have attribute the selected. very annoying
    Code HTML4Strict:
     <select name="select2" id="select2">
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3" selected="selected">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
        </select>

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It is probably supposed to do that (I have to assume you are just hitting F5) rather than SHIFT+F5/RELOAD which in Firefox will reset the form but doesn't seem to do in some other browsers. It's a User Agent thing rather than your HTML. Although technically it is recommended the select be the choice displayed as default on a load.

  3. #3
    SitePoint Addict hiddenpearls's Avatar
    Join Date
    Dec 2007
    Location
    Pakistan
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am using the browser button of FF for refresh.
    but how i should convince to my client. This behavior is just in FF not other browsers.

  4. #4
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    You simply tell them plain HTML is incapable of "memorising things" and that is what the browser does/chooses.

    Tell them the truth or just show them an example by using both methods, i.e. the plain 'Reload' F5 or the; 'Reload (override cache)', i.e. CTRL+F5 or CTRL+SHIFT+R

    Else tell them "I, said so..." that will make them tremble in there boots!


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
  •