使用JavaScript在文本框上进行Futre日期验证 [英] Futre date validation on textbox using javascript

查看:99
本文介绍了使用JavaScript在文本框上进行Futre日期验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想确认日期,以不允许用户在文本框中输入或选择将来的数据.

I want to validate date not to allow user to enter or select future data into textbox 

我该怎么做

谢谢

推荐答案

这是您的答案:


(function(){ var date = new Date(); var currentMonth = date.getMonth(); var currentDate = date.getDate(); var currentYear = date.getFullYear();
(function() { var date = new Date(); var currentMonth = date.getMonth(); var currentDate = date.getDate(); var currentYear = date.getFullYear();


('#datepicker').datepicker({ maxDate:新日期(currentYear,currentMonth,currentDate) }); });
('#datepicker').datepicker({ maxDate: new Date(currentYear, currentMonth, currentDate) }); });

#datepicker是SharePoint日期选择器控件的ID

#datepicker is the ID of your SharePoint Date Picker control


这篇关于使用JavaScript在文本框上进行Futre日期验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆