如何验证文本框上的日历扩展程序 [英] how to validate calendar extender on a textbox

查看:66
本文介绍了如何验证文本框上的日历扩展程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在文本框上验证日历扩展器...它只需要日期就可以使用过滤后的控件,并且只能将有效字符设为否.在该文本框中,我必须避免这种情况,并且必须只允许从该日历中选择日期... pls Reply

how to validate calendar extender on a textbox...it has to take only date i have use filtered control and gave valid char as no''s only...it is working fine but if we press no''s in that text box it is taking i have to avoid that and it has to allow only date to be selected from that calendar...pls reply

推荐答案

尝试以下操作: -

有一个解决方案可在所有浏览器中使用.放
在文本框中输入
try this:-

There is a soluton that works across the browsers. Put
onKeyPress = "javascript: return false;" onPaste = "javascript: return false;"

.这样,即使启用了文本框,用户也将无法修改数据.

请参考链接以获取更多详细信息:-

http://forums.asp.net/t/1117573.aspx [ http://forums.asp.net/t/1033596.aspx [ http: //stackoverflow.com/questions/3005425/how-to-check-or-validate-the-textbox-entered-date-is-in-dd-mm-yyyy-format [

in your textbox. That way, even the textbox is enabled, the user will not be able to modify the data.

Please refer the links for more details:-

http://forums.asp.net/t/1117573.aspx[^]

http://forums.asp.net/t/1033596.aspx[^]

http://stackoverflow.com/questions/3005425/how-to-check-or-validate-the-textbox-entered-date-is-in-dd-mm-yyyy-format[^]

I hope this will help you out.

Thanks


亲爱的禁用文本框,以便没有人可以访问文本框
Dear disable the textbox so that nobody can access textbox


您好,

我认为您应该将textboxt设置为只读模式....
如果您使用的是ajax工具包,那么...

参见以下示例代码:

Hi,

I think you should set your textboxt to read only mode....
If you are using ajax toolkit then...

See this sample code:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<td align="left">
   Admission Date:
</td>
<td align="left">
  <asp:textbox id="txtAdmissionDate" runat="server" maxlength="10" readonly="true"> 
   </asp:textbox>
  <cc1:calendarextender popupbuttonid="imgDatepicker" id="CalendarExtender1" targetcontrolid="txtAdmissionDate"   runat="server" filtermode="ValidChars" filtertype="Custom" validchars="1234567890/">
  </cc1:calendarextender>
  <asp:imagebutton runat="Server" id="imgDatepicker" imageurl="~/Calendar.png" />



请帮忙投票...



Please do not forget to vote if could help...


这篇关于如何验证文本框上的日历扩展程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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