A Clock will be displayed showing changing time with Hour , minutes and seconds.
User should able to use time picker to select three fields - hour , minutes and seconds. Each field will have one up and one down button to set the value. Hour field can be set between 0 - 23, minutes can be set from 0-59 and seconds can be set to 0-59.
<table><tr><td><a href=# OnClick=update_alarm('h','up')><img src=images/up.jpg border='0'></a></td><td><a href=# OnClick=update_alarm('m','up')><img src=images/up.jpg border='0'></a></td><td><a href=# OnClick=update_alarm('s','up')><img src=images/up.jpg border='0'></a></td></tr>
<tr><td><input type=text size=2 id='h1' name='h1' value=00 onBlur=update_alarm('h','none')></td><td><input type=text size=2 id='m1' name='m1' value=00 onBlur=update_alarm('m','none')></td><td><input type=text size=2 id='s1' name='s1' value=00 onBlur=update_alarm('s','none')></td></tr>
<tr><td><a href=# OnClick=update_alarm('h','down')><img src=images/down.jpg border='0'></a></td><td><a href=# OnClick=update_alarm('m','down')><img src=images/down.jpg border='0'></a></td><td><a href=# OnClick=update_alarm('s','down')><img src=images/down.jpg border='0'></a></td></tr>
</table>
User can directly enter the value in respective fields without using the buttons. Displaying the alarm set value.
While selecting the data for the alarm we will display the values for user. While setting the data we will keep the background colour of the display as Yellow. Once the alarm is set we will display Green color background. Once time is over the background color we will change to red.After fixing all the values user has to use Set Alarm button to activate the alarm.
How the Alarm Clock Script work
To set the alarm we will have three fields ( hour , minutes, Seconds ). Each field will have one pair of buttons, one for incrementing value and other for decrementing value. Each click of this button will carry two parameters to a function update_alarm(). One is type of button ( Hour , Minutes or Seconds ) , other one is direction ( Up, Down ).Here is one sample button used for incrementing minutes field (type=m, direction = Up)
No comments:
Post a Comment