www.webdeveloper.com
Results 1 to 2 of 2

Thread: javascript selectbox

  1. #1
    Join Date
    Jan 2008
    Posts
    2

    javascript selectbox

    I am trying to figure this out now for a bit and its driving me nuts.

    I have values in a database that are for a select box they are not in a certain order so .listindex is out of the order. I know the value of the select box and send that to my function. how can i change the selected on without listindex.

    like i know the right value is abc

    <option SELECTED value="abc">abc</select>
    <option value="def">def</select>

    see what i want to do is be able to change the selected from one to the other with a function without using listindex as i know how to do that already. and i can't use a if statement on values like abc as they could change if the database values change.

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    You need to do all that on the server side. As you write out the options, check the value and when you find the correct value, write "SELECTED" in the tag. If you don't understand, post on the correct server-side forum.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles