ListBox ordering the results ?

T

TomT

If I create a Listbox with 5 users:

Paul
Dave
Mark
Sam
Bob


If I select 3 users:

Paul, Dave, Mark

Is there any way to have the first name clicked as the first name in
the results ?

IE: If I click Paul, then Mark, The Bob
the results would be Paul, Mark, Bob

Howvever, If I click Mark, then Bob, Then Paul
Then the results would be Mark, Bob, Paul

At the moment the results are coming out in the order of the list !

Thanks
 
M

Michael Winter

[snip]
Is there any way to have the first name clicked as the first name in
the results ?

Unless you reorder the contents of the list, no. The easiest thing for the
browser to do is just scan the document for form elements going straight
through the source, so that's what they'll do.

And no, I don't recommend reordering the list on the client. It may not be
supported so you'll have to check and, if necessary, sort it on the server
anyway.

[snip]

Mike
 
K

kaeli

If I create a Listbox with 5 users:
If I select 3 users:

Paul, Dave, Mark

Is there any way to have the first name clicked as the first name in
the results ?

No...not reliably.
Why would you want to?
AFAIK, user agents have no requirements for how they order the list when
sending the form data. Besides, how many times have you changed your mind and
re-clicked to deselect? ;)
Any workaround will be tedious, error-prone, and more than likely, not cross-
browser. Rethink your choice of a single select element if order matters.
That's just not what they're for.

--
--
~kaeli~
All I ask is the chance to prove that money cannot make me
happy.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top