Implement only the text boxes that only allow digital input in ASP.NET are very simple, just need to take advantage of CustomerValitor controls.
The function is ok. For example, add a text box first, add a CustomerValitor control, set the CustomerValitorFunction function to isnumber, then write a custom function in the page.
Function isnumber (Source, Arguments)
{
VAR Validchars = "0123456789."
VAR char;
VAR Stext = Document.getlementByid ("TextBox1"). Value;
For (i = 0; i
{
Char = stext.charat (i);
Validchars.indexof (char) == -1)
{
arguments.issalid = false;
Return;
}
}
Return;
}
script>