add record with some validation

T

tony wong

when the user adds records to the sql database by asp page, it is better to
have some validation to check there is no same record

is it good to do it by javascript? or other method?

i wish to have a general idea how to do it. Thanks a lot.

tony
 
R

RobG

Jim said:
Javascript on the user's browser is no good. Do it on the server, where
the database is located.

I wouldn't say *no* good, validation on the client is a convenience for
users so that they don't waste time waiting for a trip to the server to
do validation.

However, it is often impractical for client-side validation to be as
thorough as server validation, nor is it a substitute for server
validation.
 
C

Charlton Wilbur

Jim Land said:
Javascript on the user's browser is no good. Do it on the server, where
the database is located.

Javascript validation on the user's browser is excellent, because it
can provide immediate feedback and prevent a trip to the server. It's
just not an adequate substitute for server-side validation, because
not everyone has Javascript turned on.

Charlton
 
D

Dr J R Stockton

Sun said:
Javascript validation on the user's browser is excellent, because it
can provide immediate feedback and prevent a trip to the server. It's
just not an adequate substitute for server-side validation, because
not everyone has Javascript turned on.

On the other hand, validation on the user's system may be the only
possibility, since processing may be confined to the user's machine -
we're not all running a business-transaction model.

At present, pages on my site send nothing back to the server. If the
user enters bad data, he should get bad results : sometimes I protect
the user against some types of error.
 
C

Charlton Wilbur

(in response to me)
On the other hand, validation on the user's system may be the only
possibility, since processing may be confined to the user's machine -
we're not all running a business-transaction model.

Well, if the user's system is the only place the user's data goes, and
the result never goes anywhere else, then the only point of the
validation is to alert the user that garbage in means garbage out.

Charlton
 

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
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top