473,326 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Preventing some characters as input in textbox

Hi

How do I on the client, when a user enters a letter into a field that is
supposed to only accept numbers to not enter the letter... that means
nothing really happens unless it's a number.

I asume this is made with javascript and I have added an onkeypress
attribute in my page load on this textbox but what do I check?

/Lars
Nov 19 '05 #1
3 1897
This article shows how to use javascript to limit numeric entry only in a
textbox:
http://steveorr.net/articles/InheritAndExtend.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Lars Netzel" <ui****@adf.se> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
Hi

How do I on the client, when a user enters a letter into a field that is
supposed to only accept numbers to not enter the letter... that means
nothing really happens unless it's a number.

I asume this is made with javascript and I have added an onkeypress
attribute in my page load on this textbox but what do I check?

/Lars

Nov 19 '05 #2
"Lars Netzel" <ui****@adf.se> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
Hi

How do I on the client, when a user enters a letter into a field that is
supposed to only accept numbers to not enter the letter... that means
nothing really happens unless it's a number.

I asume this is made with javascript and I have added an onkeypress
attribute in my page load on this textbox but what do I check?


http://www.google.com/search?sourcei...ypress+numeric
Nov 19 '05 #3
Thank you, worked fine!

/Lars

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:er**************@TK2MSFTNGP09.phx.gbl...
This article shows how to use javascript to limit numeric entry only in a
textbox:
http://steveorr.net/articles/InheritAndExtend.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Lars Netzel" <ui****@adf.se> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
Hi

How do I on the client, when a user enters a letter into a field that is
supposed to only accept numbers to not enter the letter... that means
nothing really happens unless it's a number.

I asume this is made with javascript and I have added an onkeypress
attribute in my page load on this textbox but what do I check?

/Lars


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Hans | last post by:
Hi! Can someone explain how ASP works when it comes to unicode characters on the querystring? See the testcode below. If you type in a chinese character in the first textbox and click "post" the...
1
by: Phil Amey | last post by:
I would like to prevent certain characters from being input to some form cells, e.g. ~ # ' and so on. I'm currently using this format to check the input data of cells - if...
2
by: anonieko | last post by:
This applies to javascript dynamic textbox onkey > > > Newsgroups: comp.lang.javascript From: Lasse Reichstein Nielsen <l...@hotpop.com> - Find messages by this author Date: Fri, 15 Jul 2005...
14
by: deko | last post by:
Is there a way to check user input for illegal characters? For example, a user enters something into a text box and clicks OK. At that point I'd like to run code such as this: illegal =...
11
by: anony | last post by:
Hello, I can't figure out why my parameterized query from an ASP.NET page is dropping "special" characters such as accented quotes & apostrophes, the registered trademark symbol, etc. These...
1
by: Stimp | last post by:
I have an input field, which will ultimately be stored in a database and the contents of which will be output on screen at some stage. ASP.NET has built-in functionality to prevent users inputing...
11
by: Ron L | last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the data it scans comes through as if it was typed on a keyboard. I am trying to have the data in the barcode be displayed in...
3
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I get an error on a .net 2.0 page when I use foreign characters, such as ç or ã. Setting validateRequest=false handles this, but is there a way to keep validateRequest=true but allow foreign...
13
by: RJ_32 | last post by:
looking here: http://www.devarticles.com/c/a/PHP/Getting-Intimate-With-PHPs-Mail-Function/2/ it says that I have to be careful about what I send to the sendmail process via popen(). Does that...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.