473,326 Members | 2,012 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.

Validation of user's input



Hello,

I have various textbox; in some textbox, the users can input only
characters (a-z) and in other textbox, the users are only allow to input
integers (0-9).

I used to program in VB so I used the following code:

Private Sub Text1_KeyPress(KeyAscii As Integer)

and then I will put the characteres that the user is allow to input. But
is there a same textBox1_KeyPress "properties"
in C#?

Or, how should I do to control the user's input?

Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
2 1660
On Thu, 19 May 2005 18:58:21 -0700, Claudia Fong wrote:
Hello,

I have various textbox; in some textbox, the users can input only
characters (a-z) and in other textbox, the users are only allow to input
integers (0-9).

I used to program in VB so I used the following code:

Private Sub Text1_KeyPress(KeyAscii As Integer)

and then I will put the characteres that the user is allow to input. But
is there a same textBox1_KeyPress "properties"
in C#?

Or, how should I do to control the user's input?


They are events, not properties, and you have the KeyPress event available
in C#. You might also want to consider using a masked edit control.
--
Tom Porterfield
Nov 17 '05 #2
On Thu, 19 May 2005 18:58:21 -0700, Claudia Fong wrote:
Hello,

I have various textbox; in some textbox, the users can input only
characters (a-z) and in other textbox, the users are only allow to input
integers (0-9).

I used to program in VB so I used the following code:

Private Sub Text1_KeyPress(KeyAscii As Integer)

and then I will put the characteres that the user is allow to input. But
is there a same textBox1_KeyPress "properties"
in C#?

Or, how should I do to control the user's input?


They are events, not properties, and you have the KeyPress event available
in C#. You might also want to consider using a masked edit control.
--
Tom Porterfield
Nov 17 '05 #3

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

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
5
by: EviL KerneL | last post by:
Hi - I am trying to figure out a way to enforce the validation included for this form based on whether the user chooses "email" or "phone" as the contact choice. Right now it is set to enforce...
4
by: Madha K | last post by:
I am developing a web application that need to support UTF-8 characters. For client side validations, can javascript be used to handle UTF-8 characters. 1) How javascript can be used to restrict...
6
by: MickG | last post by:
Hi, I am trying to validate these values, this seems to work fine for the phone number and name but I am trying to get the program to fail to submit and set the focus on the date when 2006 is...
16
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate...
6
by: serge calderara | last post by:
Dear all, I have read that ASP.NET does double user input validation of control when they are place on the page. Once on teh client side and again from server side right ? Could explain how...
9
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
1
by: John Chan | last post by:
Hi, Im doing a maintenance application in ajax and coldfusion at work on IE6 exclusively. I have a save button on each form and i have to do various validations server side and on client side...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: 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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.