javascript - Display only numbers in a textbox -


Work on C # asp.net C #. I'm just a text box not writing numbers.

If someone tries to write a letter, then he fails to write the letter.

The length of entering the number is limited: it can enter from 100 to 200. No more than this

  & lt; ASP: Text Box ID = "TCTSL & T" Runat = "Server" onkeydown = "Return Javascript: DigitOnly (this)" & gt; 0 & lt; / Asp: text box & gt;  

Want a nucleic text box? Where users can not just repeat any number of input numbers like: int,

like this:

  onkeydown = " Return DigitOnline (event, this); " Function DigitOnly (Event, Elm) {var key = String.fromCharCode (event.keyCode? Event.keyCode: event.which); Return key Match (/ \ d /) & amp; Amp; Elm.value.length & lt; 200; }  

You can use it with arrow keys, copy & amp; Paste, etc.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -