ListBox ordering the results ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TomT

    #1

    ListBox ordering the results ?

    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
  • Michael Winter

    #2
    Re: ListBox ordering the results ?

    On Fri, 20 Aug 2004 11:16:15 +0000 (UTC), TomT <tomt@adslweb.c o.uk> wrote:

    [snip]
    [color=blue]
    > Is there any way to have the first name clicked as the first name in
    > the results ?[/color]

    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

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.

    Comment

    • kaeli

      #3
      Re: ListBox ordering the results ?

      In article <r7nbi015fd2emm p7pv8hdjrkh230l q7vdt@4ax.com>, tomt@adslweb.co .uk
      enlightened us with...[color=blue]
      > If I create a Listbox with 5 users:
      >[/color]
      <snip>[color=blue]
      >
      > 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 ?
      >[/color]

      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.



      Comment

      Working...