[Javascript] action="insert"

Falls, Travis D (HTSC, CASD) Travis.Falls at thehartford.com
Fri Feb 10 08:35:18 CST 2006


Here's a question (that I don't know the answer to) would it be prudent to check to see if javascript and cookies are turned on in the beginning render of a page, if so use an AJAX-ish method to communicate with the server and say... we are all set no need to do server side checks or... do them if javascript is off?  Just an idea.

Travis D. Falls | Consultant   RAFT.Net   IT | 860.547.4070 | travis.falls at thehartford.com 

-----Original Message-----
From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu]On Behalf Of Shawn Milo
Sent: Friday, February 10, 2006 9:22 AM
To: [JavaScript List]
Subject: Re: [Javascript] action="insert"




On 2/10/06, David Dorward < david at dorward.me.uk> wrote: 

On Fri, Feb 10, 2006 at 08:58:51AM -0500, Shawn Milo wrote:
>    For my ASP pages, I find that using JavaScript as much as possible to
>    validate the form before it is submitted saves me a *lot* of work. If >    something is entered incorrectly and the problem is found after the page
>    is submitted, I then have to put all of the values from that page into
>    variables and insert server-side code into each HTML object to 
>    conditionally set that content as the default value for the object.

The problem with depending on JavaScript for this is that if
JavaScript is turned off then the for msubmits without the checks
being performed. 

A client side check can be fantastic for saving the user time (in that
they don't have to wait for a server round trip), but it doesn't
protect users without JavaScript from silly mistakes, or your database
(or email server, or whatever the ASP interacts with) from malicious
users.


--
David Dorward                                       http://dorward.me.uk

_______________________________________________ 
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript




Good point. I should mention that the users of my intranet applications are all using a standard PC image, and I know what browser they are using and that they have JavaScript enabled. For an application available on the Internet, I can see the value of the other method. 

However, do you have a more elegant solution to repopulating the form than the method I mentioned in my earlier e-mail? It would sure be nice to have something cleaner. Trust me -- I did it that way for a long time because I was following others' code. But when I started creating my own new applications, I found JavaScript validation to be so much nicer, and so much less work -- especially when adding new fields to a form. New fields only require a cut & paste of a couple of JavaScript lines, while fixing server-side validation requires changes in several places. 

Shawn




*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information.  If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited.  If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060210/ecf1d6a1/attachment.htm>


More information about the Javascript mailing list