Disallow $ sign entry

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

Does anyone know of a way to keep a user from entering a $ in a TextBox?
When a $ is entered, the SQL Update bombs. Thanks.

David
 
You have two choices:

1. Write some Java script on the client that strips it out while the user is
entering the test (this is the way I would go).

2. Write some code serverside that does the same thing.

David

======================================
David McCarter [Microsoft MVP]
www.dotNetTips.com
David McCarter''s .NET Coding Standards available at:
http://codingstandards.notlong.com
 
Hi all

It is quite important to validate user input server-side for security
reasons. Anything that will be used to form part of an SQL query or
command must be checked. Client-side filtering is fine to prevent
unnecessary round trips but it won't block malicious software spoofing
a web browser.

I therefore recommend both.
 
Back
Top