473,385 Members | 1,872 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,385 software developers and data experts.

add record with some validation

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
Oct 24 '06 #1
8 1393
"tony wong" <x3*@netvigator.comwrote in news:45********@127.0.0.1:
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 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.
Oct 24 '06 #2

Jim Land NO SPAM wrote:
"tony wong" <x3*@netvigator.comwrote in news:45********@127.0.0.1:
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

Oct 24 '06 #3
Thanks a lot. i also feel some implications on it.
"RobG" <rg***@iinet.net.au¼¶¼g©ó¶l¥ó·s»D:11************** ********@h48g2000cwc.googlegroups.com...
>
Jim Land NO SPAM wrote:
>"tony wong" <x3*@netvigator.comwrote in news:45********@127.0.0.1:
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

Oct 24 '06 #4
Jim Land <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrites:
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

Oct 29 '06 #5
Charlton Wilbur <cw*****@mithril.chromatico.netwrote in
news:87************@mithril.chromatico.net:
Jim Land <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrites:
>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.

Oct 29 '06 #6
Thanks a lot.

i am now more clear about javascript.
"Jim Land" <RrrrFfffTttt(NO)@(SPAM)hotmail.com¼¶¼g©ó¶l¥ó·s»D: Xn**********************************@216.168.3.44. ..
Charlton Wilbur <cw*****@mithril.chromatico.netwrote in
news:87************@mithril.chromatico.net:
>Jim Land <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrites:
>>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.

Oct 29 '06 #7
In message <87************@mithril.chromatico.net>, Sun, 29 Oct 2006
10:50:56, Charlton Wilbur <cw*****@mithril.chromatico.netwrites
>Jim Land <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrites:
>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.
Oct 30 '06 #8

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

(in response to me)
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
Oct 30 '06 #9

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

Similar topics

3
by: Dalan | last post by:
I apparently need a bit of assistance regarding the structure of some validation code on the BeforeUpdate or AfterUpdate event on a form for several fields that need to controlled. I did search the...
2
by: Joey P | last post by:
Hi all, I am doing a project for university whereby i have to implement a simple database related to a frozen foods company. I am having some trouble though creating a validation rule for one...
5
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and...
2
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the...
9
by: master | last post by:
Actually, it is not only the record locking, what I need, and nobody seems to descibe this. Imagine the following scenario. There is a database with, say 10000 records with some unvalidated...
10
by: Bhavna | last post by:
I am using a Replace function to replace single quotes with double when submitting a text field in the database i.e. Replace (q, "'", "' ' ") which works fine. When I retrieve the field from the...
6
dragonsbreath
by: dragonsbreath | last post by:
Firstly I am not a coder. I am trying to add a validation rule to an input form that will prevent users’ creating more than one record per organisation. This DLookUp seems to work ...
2
by: AMBLY | last post by:
Hello! Would be grateful for help with this one - a Record level Validation problem I run Access 2000 on XP A form has two fields: 1) fldLevel – it’s an Option Group with 4 choices = 1, 2,...
5
by: sharmilah | last post by:
Hi all I would be grateful if you could help me in the following issue. I have a form on which I can recall records and modify them. On clicking on the push button 'post', the modified record is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.