Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Time Control in HTML

Reply
Thread Tools

Time Control in HTML

 
 
Doogie
Guest
Posts: n/a
 
      11-28-2007
Hi,
I need to build a time control in HTML and am looking for some advice
for the best way to do this. I need the control to allow users to
enter a time in the following format "11:46 am" and have it complain
when they do not. Any ideas would be helpful, up to and including if
there is code out there that already does this. I'm figuring some of
this will have to be done in javascript (because this is for an old
legacy asp app I'm doing this in) but am starting here first in this
group.
 
Reply With Quote
 
 
 
 
Adrienne Boswell
Guest
Posts: n/a
 
      11-29-2007
Gazing into my crystal ball I observed Doogie <>
writing in news:54fe68db-d514-4af4-b761-
:

> Hi,
> I need to build a time control in HTML and am looking for some advice
> for the best way to do this. I need the control to allow users to
> enter a time in the following format "11:46 am" and have it complain
> when they do not. Any ideas would be helpful, up to and including if
> there is code out there that already does this. I'm figuring some of
> this will have to be done in javascript (because this is for an old
> legacy asp app I'm doing this in) but am starting here first in this
> group.
>


Cannot be done with HTML alone. Client side script for validation is a
good idea, but you really need to do validation on the server to account
for those who do not have javascript enabled.

Now, one thing you _could_ do is present the input in two select boxes,
eg:

<select name="hour">
<option value="0">12am</option>
<option value="1">1am</option>
....
<option value="23">11pm</option>
</select>
<select name="minute">
<option value="0">00</option>
....
<option value="59">59</option>
</select>

Then you can put the two values together server side to make your time.

Now

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
Help on HTML server control vs HTML control =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?= ASP .Net 5 09-15-2005 07:51 PM
HTML Client Control versus. HTML Server Control versus. Web Server Control Matthew Louden ASP .Net 1 10-11-2003 07:09 PM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net Building Controls 1 07-02-2003 08:05 AM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net 0 07-01-2003 09:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57