[Javascript] action="insert"

Shawn Milo Shawn at Milochik.com
Fri Feb 10 08:21:57 CST 2006


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060210/ad160a79/attachment.htm>


More information about the Javascript mailing list