Results 1 to 2 of 2

Thread: Select Box

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 1999
    Posts
    8

    Exclamation

    I have a slect combo box that contains a list of fields. When you click on a field, the page reloads with a querystring variable that is equal to the value of the field in the select box. An sql statement then displays all the information for that particular field. My question is:

    How do I keep the field that is selected as the text in the select box?

    Any help?

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    add selected to the option tag. use an if statement when writing the data to the box to see if it is equal to the querystr8ng and if it is add selected to the option..Should end up looking like this

    <option selected>Hey</option>
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

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



Click Here to Expand Forum to Full Width