Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down - multiples allowed - ordering elements

Status
Not open for further replies.

hithere

Programmer
Jul 12, 2001
214
US
Hey all!
we've got a drop down box with 2 weeks worth of dates that being dynamically generated. separating the two weeks is the entry "select dates". the first week (above select dates) is only visible to a small user group. everyone can see the following week (below select dates). we want the users to be able to choose multiple days so that is enabled. Now, the catch. we want the size of the box to display a week and for the "select dates" to be at the top of the box (selected) for all users. With multiple selections allowed it's not letting us order the elements. Thoughts? work arounds?

"Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!"
Marvin the Martian
 
Can't you just order the date strings as they come out of the database (assumed) and set the select size to 8...everyone will see the same 8 values, your "select dates" and the 7 second week values...
 
well...we are doing that but the idea is the that the first item in the box would be the "select dates" (which hides the first week and leaves the current week revealed). it appears that because "multiple" is on, you're not able to order the elements. see below (print is just a shortcut for response.write:

<select size=&quot;7&quot; name=&quot;fDates&quot; multiple>
<%

for x = 0 to 6
Print &quot;<option value = &quot;&WeekBegin-(7+x)&&quot;>&quot;&WeekBegin-(7+x)&&quot; &quot;&WeekDayName((x mod 7)+1)&&quot;</option>&quot;
next

Print &quot;<option Selected>Select Date</option>&quot;
for x = 0 to 7*MaxWeeks-1
Print &quot;<option value = &quot;&WeekBegin+x&&quot;>&quot;&WeekBegin+x&&quot; &quot;&WeekDayName((x mod 7)+1)&&quot;</option>&quot;
next
Print &quot;</select>&quot;

&quot;Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!&quot;
Marvin the Martian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top