SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2011
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The default position of the cursor when going back and forth between pages

    Please help me understand how this works in HTML. I go to the following site:

    http://iic.tulsacounty.org/SearchForm.aspx

    …and I do a search for First Name: "foo" and then I click Process Search. I get no search results, then I hit the Back button. When I look at this page using Firefox 13.0 on a Mac, the foo search term is still there and the First Name textbox is active and the cursor is at the start of the word "foo." When I look at this page using Safari 5.1.2 on a Mac, the cursor is at the end of the word "foo."

    https://twitter.com/#!/search-home has the same behavior: Firefox 13 gives the cursor on the left side when pressing the Back button, and Safari 5.1.2 gives the cursor on the right.

    However, http://clinicaltrials.gov/ct2/search is different. In Firefox 13 gives the cursor on the left, but in Safari the cursor is not in the textbox when pressing the Back button.

    So, why does this happen? Assuming I just have your basic <form><input></form> HTML textbox, what can I do to make sure that the cursor will always be on the far right, regardless of browser? My users will want to search for something, then hit the Back button and only change the last digit of a search string of numbers, and then search again.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by MrSnrub View Post
    o, why does this happen? Assuming I just have your basic <form><input></form> HTML textbox, what can I do to make sure that the cursor will always be on the far right, regardless of browser? My users will want to search for something, then hit the Back button and only change the last digit of a search string of numbers, and then search again.
    The ways that web browser behave with forms differ. The best thing you can do is to ensure that the person using your page has a consistent experience as they do with other pages from that web browser they are using. So the less messing around that you do, the better it is for them.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Tags for this Thread

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
  •