【发布时间】:2011-07-13 20:25:13
【问题描述】:
我是 javascript 世界的新手,即使尝试 google 搜索也没有真正帮助我找到我要找的东西。
所以我来到这里希望你能指出我正确的方向。
RULE= 不能点击!可以通过tab来完成!
我有许多文本字段,用户将输入已记录的时间。
例如事件 1 发生在上午 11:31 事件 2 发生在上午 11:59
我希望通过将文本框设置为 24 小时格式的小时和秒格式,让用户尽可能轻松地完成此过程:
所以文本框值= 00:00,当用户选择文本框时,他们可以输入小时部分。然后会跳转到秒部分。
如果有什么可以做到这一点的任何想法,如果可以的话,你可以链接我。如果不能,你能给我一个关于编码的想法以及是否有更简单的替代方案。
我做了一些伪代码来帮助你理解我的实现目标:
for count = 0 , while count is less than 20, count++
{
create a texbox with name time+count, set the value to ="00:00"
}
when the user enters numbers they go into the hour segment until that is completed
the script then jumps the cursor to the minutes segment
if time+count+1 is lesser thatn time+count message user that time error "An event cannot occur before the previous event"
谢谢你听我说完!
【问题讨论】:
-
要开始使用,请在“时间选择器”上进行谷歌搜索
-
是的,但这意味着我的用户必须单击并选择,而不仅仅是制表符并输入时间! :)
-
Google/Bing:自动标签 JavaScript
标签: javascript time