如何制作一个只允许使用大写字母的文本框 [英] how to make a text box where only upper letter character are allow
本文介绍了如何制作一个只允许使用大写字母的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好先生,
如何制作一个文本框
1.只允许使用大写字母(A到Z)。其他特殊字符/数字/空格是不允许的。
2.在其他文本框中只允许使用数字(0到9),而不是特殊字符//空格。 &数字是10 ..
我是怎么做的..
Hello sir,
how to make a text box where
1. Only upper letter characters(A to Z) are allow.Others special characters/number/space are not allow.
2. in other text box only numbers (0 to 9)are allow, not special characters//space. & the number of digit is 10..
how i do this ..
推荐答案
使用ajax过滤器文本框扩展器
http:// www .asp.net / ajaxLibrary / AjaxControlToolkitSampleSite / FilteredTextBox / FilteredTextBox.aspx [ ^ ]
use ajax filter textbox extender
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/FilteredTextBox/FilteredTextBox.aspx[^]
// i had textbox to enter isbn number which include neumerics and '-' character
// so i used filter text box extender
<asp:TextBox ID="txtISBN" runat="server" CssClass="textbox" Width="200px" MaxLength="15">
</asp:TextBox>
<asp:FilteredTextBoxExtender ID="txtISBN_FilteredTextBoxExtender"
runat="server" Enabled="True" TargetControlID="txtISBN" ValidChars="0123456789-">
</asp:FilteredTextBoxExtender>
// if you dont have ajax toolkit then
// check this link where people did with jquery
// http://stackoverflow.com/questions/995183/how-to-allow-only-numeric-0-9-in-html-inputbox-using-jquery
// http://www.thimbleopensource.com/tutorials-snippets/jquery-plugin-filter-text-input [ ^ ]
这篇关于如何制作一个只允许使用大写字母的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文