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 4 of 4
  1. #1
    New Coder
    Join Date
    Dec 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Focus on first record in recordset

    I have some data coming into a drop down list and it is ordered by ascending, but the focus is always on the last record. Does anyone have a fix to make it focus on the first record in the list?

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    You could add the "selected" attribute to the option in the select box:

    Code:
    <option value="value" selected="selected">item</option>

  • #3
    New Coder
    Join Date
    Dec 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I forgot to mention that the data is coming from MySql...

  • #4
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    It doesn't matter… MySql is just holding the data. You're probably using PHP or some other server-side language to output the list; it's there that you want to code the logic that adds the appropriate HTML.

    Hope this helps…


  •  

    Posting Permissions

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