|
查看: 1030|回复: 1
|
如何在javascript验证yyyy-mm-dd是星期六?
[复制链接]
|
|
|
如何在javascript验证yyyy-mm-dd是星期六
我的form的input如下,收到的value是yyyy-mm-dd,e.g:2008-11-11
<input id="exampleII" name="dateTo" type="text" style="width: 115px;" maxlength="10" />
然后我需要javascript帮我验证收到的value是否星期六,然后prompt出来告诉那天是星期六,然后重新输入! |
|
|
|
|
|
|
|
|
|
|
发表于 22-10-2008 07:59 PM
|
显示全部楼层
用Date object的getDay() function....
constructor
Date(year, month, day)
getDay()
Returns a number specifying the day of the week. Zero is for Sunday, one for Monday and so on. |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|