我有两个html文本框控件.在这两个文本框中,我都将仅从日历控件中输入日期,两个文本框均为只读.我想限制用户在第二个文本框中输入较高的日期. [英] I have two html text box control.In both i will enter only date from calender control,Both the textboxes are readonly.I want to restrict the user to enter higher date in second text box.

查看:97
本文介绍了我有两个html文本框控件.在这两个文本框中,我都将仅从日历控件中输入日期,两个文本框均为只读.我想限制用户在第二个文本框中输入较高的日期.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个html文本框控件.在这两个框中,我都将只输入日历中的日期,两个文本框都是只读的.我想限制用户在第二个文本框中输入更高的日期.


请给我代码.

I have two html text box control.In both i will enter only date from calender control,Both the textboxes are readonly.I want to restrict the user to enter higher date in second text box.


Please give me the code.

推荐答案

这根本没有意义.遵循简单的逻辑:如果两个文本框都是只读的,那么您已经限制了用户根本不输入任何内容,而不仅限于日期.请记住,只读"控件实际上意味着阻止任何用户输入.

我需要添加一些积极的东西吗?当然.建议如下:不要使用文本框,而是要给用户一个很大的帮助,并提供一个DateTimePicker.例如,考虑以下示例: DateTimePicker Web控件 [
It makes no sense at all. Follow the simple logic: if both of the text boxes are read-only, you already restrict the user from entering anything at all, not only the date. Remember that "read-only" control really means preventing any user input.

Do I need to add something positive? Certainly. Here is the advice: instead of using text boxes, do your users a great favor and provide a DateTimePicker. For example, consider this one: DateTimePicker Web Control[^].

It will greatly improve things but probably won''t solve your problem. As one of the possible alternatives, consider this: use DateTimePicker to input some point in time, and for the second time point, allow the user to enter the time span, say, in seconds or days, or whatever is more appropriate. This way, the constraints will be reduced to the problem of entering a non-negative value (or negative or 0, whatever), which is much simpler and more clear for the user.

—SA


这篇关于我有两个html文本框控件.在这两个文本框中,我都将仅从日历控件中输入日期,两个文本框均为只读.我想限制用户在第二个文本框中输入较高的日期.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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