Javascript time helper? -Interesting problem! -



Javascript time helper? -Interesting problem! -

i new world of javascript , trying google search has not helped me find looking for.

so have come here in hope can point me in right direction.

rule= must not click! can done tabbing!

i have many text fields user input times have been recorded.

e.g. event 1 happened @ 11:31am event 2 happened @ 11:59am

i want create process easy possible user having textbox formatted in hours , seconds in 24hr format:

so textbox value= 00:00 , when user selects text box can come in hours part. jump seconds part.

any thought if there can if link me. if not give me thought of coding , if there easier alternatives.

i have made pseudo code help understand implementation goal:

for count = 0 , while count less 20, count++ { create texbox name time+count, set value ="00:00" } when user enters numbers go hr segment until completed script jumps cursor minutes segment if time+count+1 lesser thatn time+count message user time error "an event cannot occur before previous event"

thankyou hearing me out!

i don't know of time pickers suit needs, here's basic thought of how 1 implemented:

you have 2 textboxes, or multiple pairs of textboxes in each textbox, set event handler handle "onkeyup" event in onkeyup handler, check if lenght of text in box 2 if length 2 -> focus next textbox

this way user can maintain on typing numbers.

you may need add together additional checks event listener, illustration create sure if user comes field, can edit (eg. if press shift-tab, won't focus wrong field)

if wanted fancy, have single textbox times. then, each time user presses key, you'd check if it's number. if user first types 2 numbers, insert : separator if 3rd key number, , on.

javascript time

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -