Click here to Skip to main content
15,908,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 ..
Posted
Comments
Hemant Singh Rautela 6-Apr-13 5:58am    
Filtered Text Box is good option or you can use javascript code for it...which check by keycode
Tiwari Avinash 6-Apr-13 7:07am    
Are cyou creating a custom control? or you need validation for your text box. if you want to use validation u can use ajax regular expression validator or you can use Java Script.

 
Share this answer
 
Comments
prodipjsr 6-Apr-13 6:00am    
Thank you Santosh,
where i write this code. can u give a example.please help me!!
XML
// 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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900