Click here to Skip to main content
15,886,059 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
pls tell me code for insert only integer value in a textbox.
Posted
Comments
Sandeep Mewara 21-Oct-12 5:46am    
Any effort?

If you are using C# then try this.
This will allow the user to enter the numeric values.
XML
<asp:TextBox ID="txt_ID" runat="server" ></asp:TextBox>
//Add Extender
<asp:FilteredTextBoxExtender ID="txt_ID_FilteredTextBoxExtender" FilterType="Numbers" runat="server" Enabled="True" TargetControlID="txt_ID"> </asp:FilteredTextBoxExtender>


To know about the FilteredTextBoxExtender [^]
 
Share this answer
 
v2
Hi,
You can add input masking on top of your textbox. There is lots of masking solution available with javascript. I prefer this one below, with this plugin you can define your input mask,
http://digitalbush.com/projects/masked-input-plugin/[^]

Hope this will help.
 
Share this answer
 
Comments
Arunprasath Natarajan 20-Oct-12 8:52am    
Well said
Shahriar Iqbal Chowdhury/Galib 20-Oct-12 14:29pm    
thanks

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