numeric edit control for web forms?

K

Karl

Does anyone know of a numeric edit control for a web forms application?

How about one that keeps the numbers right aligned?

TIA
 
S

Steve C. Orr [MVP, MCSD]

This code provides a Textbox that only accepts numbers:

<asp:textbox

runat="server" OnKeyPress="ValidateNumeric()"/>

<script language="Javascript">

function ValidateNumeric()

{

var keyCode = window.event.keyCode;

if (keyCode > 57 || keyCode < 48)

window.event.returnValue = false;

}

</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top