如何限制在asp.net中的文本框中输入任何类型的数据 [英] How to restrict entering any type of data into Textbox in asp.net

查看:58
本文介绍了如何限制在asp.net中的文本框中输入任何类型的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.

在我的应用程序中,我使用JQuery将TextBox转换为日历控件,它的工作正常,但问题是TextBox允许用户键入数字和特殊字符.

我想限制TextBox输入除通过压延机控件选择的日期以外的任何类型数据.

请任何人帮助我得到这个.


在此先感谢
Uday

Hi all.

In my application I converted TextBox`s as Calender control using JQuery, its working fine but the problem is that TextBox`s allowing the user to type numeric and special characters.

I want to restrict TextBox`s to enter any type data except date selected throught calender control.

Please any body help me to get this.


Thanks in Advance
Uday

推荐答案

引用相似的线程
如何验证ASP:文本框仅接受日期格式? [
Refer similar thread
How to Validate ASP:Textbox to accept only date formats?[^]




试试这个

Hi,

try this

<asp:textbox id="TextBox1" runat="server" readonly="true" onclick="f1()" xmlns:asp="#unknown"></asp:textbox>





function f1() {


(" #TextBox1").val( Fdgdfg"); }
("#TextBox1").val("Fdgdfg"); }



在上面的代码中,通过单击文本框上的日历日历来更改文本.

最好的



In the above code change text by using calender popup on click of textbox.

All the Best


这篇关于如何限制在asp.net中的文本框中输入任何类型的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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