Time Control in HTML

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.
Doogie [ Mi, 28 November 2007 18:32 ] [ ID #1881258 ]

Re: Time Control in HTML

Gazing into my crystal ball I observed Doogie <dnlwhite [at] dtgnet.com>
writing in news:54fe68db-d514-4af4-b761-
cc6110d3d99c [at] j20g2000hsi.googlegroups.com:

> 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
Adrienne Boswell [ Do, 29 November 2007 03:52 ] [ ID #1882269 ]
Miscellaneous » alt.html » Time Control in HTML

Vorheriges Thema: What is the recommended XSLT forum?
Nächstes Thema: side post, semi-off topic