Connecting Tech Pros Worldwide Forums | Help | Site Map

add record with some validation

tony wong
Guest
 
Posts: n/a
#1: Oct 24 '06
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


Jim Land
Guest
 
Posts: n/a
#2: Oct 24 '06

re: add record with some validation


"tony wong" <x34@netvigator.comwrote in news:453d7e54$1@127.0.0.1:
Quote:
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?
Javascript on the user's browser is no good. Do it on the server, where
the database is located.
Quote:
>
i wish to have a general idea how to do it.
Take the data the user has submitted and search for some of it in the
database. For example, user name, last name, first name, social security
number, postal code. Best to do this ignoring case (upper & lower).

If you find an existing record, it *might* be the same record. If you
don't find an existing record, the new record *might* not exist in the
database.
RobG
Guest
 
Posts: n/a
#3: Oct 24 '06

re: add record with some validation



Jim Land NO SPAM wrote:
Quote:
"tony wong" <x34@netvigator.comwrote in news:453d7e54$1@127.0.0.1:
>
Quote:
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?
>
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.


--
Rob

tony wong
Guest
 
Posts: n/a
#4: Oct 24 '06

re: add record with some validation


Thanks a lot. i also feel some implications on it.


"RobG" <rgqld@iinet.net.au撰寫於郵件新聞:1161662009.93896 1.240020@h48g2000cwc.googlegroups.com...
Quote:
>
Jim Land NO SPAM wrote:
Quote:
>"tony wong" <x34@netvigator.comwrote in news:453d7e54$1@127.0.0.1:
>>
Quote:
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?
>>
>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.
>
>
--
Rob
>

Charlton Wilbur
Guest
 
Posts: n/a
#5: Oct 29 '06

re: add record with some validation


Jim Land <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrites:
Quote:
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

Jim Land
Guest
 
Posts: n/a
#6: Oct 29 '06

re: add record with some validation


Charlton Wilbur <cwilbur@mithril.chromatico.netwrote in
news:87hcxnf7dr.fsf@mithril.chromatico.net:
Quote:
Jim Land <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrites:
>
Quote:
>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.
Sorry, I wasn't clear. I meant Javascript validation is no good IN THIS
CASE, because the original poster wanted to see if the record the user is
entering is already in the database ON THE SERVER.

I agree that client-side validation has its place, and can be very
useful, in checking whether required items are present, etc.

Additionally, JS and AJAX can be used to query the server to see if the
record being entered is already in the server's database, but the
original poster's competence level didn't seem to merit mentioning it.

tony wong
Guest
 
Posts: n/a
#7: Oct 29 '06

re: add record with some validation


Thanks a lot.

i am now more clear about javascript.


"Jim Land" <RrrrFfffTttt(NO)@(SPAM)hotmail.com撰寫於郵件新聞: Xns986B7929EFC0DRrrrFfffTttt4396hotm@216.168.3.44. ..
Quote:
Charlton Wilbur <cwilbur@mithril.chromatico.netwrote in
news:87hcxnf7dr.fsf@mithril.chromatico.net:
>
Quote:
>Jim Land <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrites:
>>
Quote:
>>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.
>
Sorry, I wasn't clear. I meant Javascript validation is no good IN THIS
CASE, because the original poster wanted to see if the record the user is
entering is already in the database ON THE SERVER.
>
I agree that client-side validation has its place, and can be very
useful, in checking whether required items are present, etc.
>
Additionally, JS and AJAX can be used to query the server to see if the
record being entered is already in the server's database, but the
original poster's competence level didn't seem to merit mentioning it.
>

Dr J R Stockton
Guest
 
Posts: n/a
#8: Oct 30 '06

re: add record with some validation


In message <87hcxnf7dr.fsf@mithril.chromatico.net>, Sun, 29 Oct 2006
10:50:56, Charlton Wilbur <cwilbur@mithril.chromatico.netwrites
Quote:
>Jim Land <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrites:
>
Quote:
>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.
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) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Charlton Wilbur
Guest
 
Posts: n/a
#9: Oct 30 '06

re: add record with some validation



Dr J R Stockton <jrs@merlyn.demon.co.ukwrites:

(in response to me)
Quote:
Quote:
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.
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
Closed Thread