?
Solved

List box and PHP

Posted on 2003-03-14
3
Medium Priority
?
221 Views
Last Modified: 2006-11-17
Hi,

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 !!

John
0
Comment
Question by:JohnnyQ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
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>Item_1</OPTION>
      <OPTION>Item_2</OPTION>
      <OPTION>Item_3</OPTION>
      <OPTION selected>Item_4</OPTION>
      <OPTION>Item_5</OPTION>
      <OPTION>Item_6</OPTION>
      <OPTION>Item_7</OPTION>
</SELECT>

Igor.
0
 
LVL 15

Expert Comment

by:VGR
ID: 8138642
yes, answered three days ago
0
 

Author Comment

by:JohnnyQ
ID: 8138675
Thanks for your answer !!!

JohnnyQ
0

Featured Post

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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

765 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