constraint on time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bugthefixer
Forum Contributor
Posts: 118
Joined: Mon Mar 22, 2004 2:35 am

constraint on time

Post by bugthefixer »

i hav a form where i want to enter time...my time field looks like this
00:00
and code for this is
<input name="arr_time" type="text" value="00:00" size="5" maxlength="5" >

now i want to make like it this so that ':' remains there and when user enter two numbers then it jumps directly to the values after ':', secondaly how can i apply costraints over it so tat user cannot enter hours over 24 and seconds over 60...
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

To make it easier, separate the hours and minutes into two separate text fields, then it is easy to validate the numbers entered and you can recombine them any way you like.

Mac
Post Reply