List box and PHP

Posted on 2003-03-14
Medium Priority
Last Modified: 2006-11-17

I'm currently populating a list box with a SQL query.

The thing is that I want to choose wich item in the list box will appear first.

For Example, I'm putting, in order, those words : orange, kiwi, banana, apple in a list box, and I want to have
the "apple" list first... how can I do that ???

Thanks for your help guys !!

Question by:JohnnyQ

Accepted Solution

igor_sk earned 80 total points
ID: 8138268
Hi John,

You should mark this item "selected". If your SELECT element does allows single selection only (this is a default) then the list will be scrolled to selected item. In the following example Item_4 is selected and the list will be scrolled to it.

<SELECT name="item-select" size=4>
      <OPTION selected>Item_4</OPTION>

LVL 15

Expert Comment

ID: 8138642
yes, answered three days ago

Author Comment

ID: 8138675
Thanks for your answer !!!


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question