Disallow $ sign entry

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
 
D

dotNetDave

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
 
S

Stan

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.
 

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,817
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top