Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Dynamic Dropdown Box
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dynamic Dropdown Box

 Post Reply Post Reply
Author
Diddl View Drop Down
Newbie
Newbie
Avatar

Joined: 11 September 2003
Location: Denmark
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diddl Quote  Post ReplyReply Direct Link To This Post Topic: Dynamic Dropdown Box
    Posted: 21 June 2005 at 4:00am
Hi

Im currently working on a online booking system, and i need to have a dropdownbox filled with time values starting from time X like 09:00 and end 16:00

All time values showed with a 15 min so it looks like this:

<option value="8:00">8:00</option>
<option value="8:15">8:15</option>
<option value="8:30">8:30</option>
<option value="8:45">8:45</option>
<option value="9:00">9:00</option>
etc...

i could put all the values in a database, but i would like to do without if possible?

Hope someone can help me.
Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post Posted: 21 June 2005 at 4:43am
Something like


starttime = 12

    For i = 1 To 100
        Response.write(Formatdatetime(DateAdd("n", 15, starttime), 3) & "<br>")
        starttime = FormatDateTime(DateAdd("n", 15, starttime), 3)
    Next



of the top of my head so you will need to mod it to suit.
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 21 June 2005 at 7:14pm
use 4 in the formatdatetime so it'll keep it in 24 hr time
  
<select>
<%
starttime = 9
starttime = FormatDateTime(starttime,4)
 
For i = 1 To 28
%>
<option value="<%=starttime%>"><%=starttime%></option>
starttime = FormatDateTime(DateAdd("n",15,starttime),4)
<%
Next
%>
</select>
 


Edited by ub3rl337ch3ch - 21 June 2005 at 7:16pm
Back to Top
Diddl View Drop Down
Newbie
Newbie
Avatar

Joined: 11 September 2003
Location: Denmark
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diddl Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2005 at 4:36pm
Thanks for the help

I used the first script you wrote, to help me figure out a way to make it work... It got modified a lot, but i was just the thing i needed to see the way.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.