Depending on how complex your validation schema is, may be one factor in
determine if JavaScript is appropriate or if server-side processing is the right
thing to do. For example, you may have complex validation logic, or require that
a dynamic page be presented under certain error conditions, or serve up messages
from a database. There are many other reasons that I have come across where
server side proccessing is the best solution.

Another thought... a site may have requirements to gaurd against browsers that
don't support JavaScript. This is especially true with sites that require
adherence to accessibility standards. W3C standards for accessibility discourage
the use of client side processing because it makes the page less accessible to
those who are vision impaired or with other accessibility needs. In these cases,
the only solution is server side proccessing.

As to the code below, the logic seems perfectly acceptable, but it is simple
enough that one might want to consider client side processing using JavaScript.

As with most web architectures, there is hardley ever a "one size fits all"
solution.

-ernie


David Mossakowski wrote:

> First of all form validation should proabaly be done in JavaScript on the
> client (too silly to come back to server for) and second of all that's pretty
> much all you can do.
>
> Some mail servers allow for checking if a given user exists on them but this
> can't be relied upon.
>
> dave.
>
> "blueads.com" wrote:
>
> > Does anyone have a good example of checking for valid email that they care
> > to share? Better than this one?
> >
> > // Make sure email it is not null
> > if(email == null)
> >                 return false;
> >                 int length=email.length();
> > if((length > 3 && length < 31) && (email.indexOf('@') > -1) &&
> > (email.indexOf('.') > -1))
> >                         return true;
> >                 else
> >                         return false;
> >
> > Tom K.
> >
> > ___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> --
> David Mossakowski              [EMAIL PROTECTED]
> Programmer                           212.310.7275
> Instinet Corporation
>
> "I don't sit idly by, I'm planning a big surprise"
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
begin:vcard
n:Varitimos;Ernie
tel;cell:781-929-3856
tel;home:781-784-1997
tel;work:781-784-3900
x-mozilla-html:TRUE
url:http://www.skyserver.com
org:Skyserver Consulting, Inc.
adr:;;144 Upland Rd;Sharon;MA;02067;
version:2.1
email;internet:[EMAIL PROTECTED]
title:President
fn:Ernie Varitimos
end:vcard

Reply via email to