Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 85891 invoked from network); 1 Aug 2006 15:02:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2006 15:02:32 -0000 Received: (qmail 71457 invoked by uid 500); 1 Aug 2006 15:02:22 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 71431 invoked by uid 500); 1 Aug 2006 15:02:22 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 71420 invoked by uid 99); 1 Aug 2006 15:02:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 08:02:22 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of adam.gordon@readytalk.com designates 208.50.222.164 as permitted sender) Received: from [208.50.222.164] (HELO merlin.ecovate.com) (208.50.222.164) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 08:02:21 -0700 Received: from [192.168.1.183] (AZTEC [192.168.1.183]) by merlin.ecovate.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id LW5ZC3D8; Tue, 1 Aug 2006 09:01:55 -0600 Message-ID: <44CF6D04.7070602@readytalk.com> Date: Tue, 01 Aug 2006 09:02:28 -0600 From: Adam Gordon User-Agent: Thunderbird 1.5.0.5 (X11/20060728) MIME-Version: 1.0 To: Struts Users Mailing List Subject: Re: problem w.r.t javascript References: <1ec09c0f0607312315l669f7ef7o91d097601ee5b591@mail.gmail.com> In-Reply-To: <1ec09c0f0607312315l669f7ef7o91d097601ee5b591@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Rauf- Are you doing client or server-side validation? Or both? W.R.T your multiple errors, there is an attribute you can set in your struts XML file, namely: | | Note that you must be using Struts >= 1.2.0 for this feature, though I believe prior to 1.2.0, the behavior was to always stop on the first error. I'm a little confused by your explanation but it sounds like you're possibly missing the XML in your JSP for the email field since you say it doesn't show up - the other rationale is that it's a valid email address. Also, just an FYI, your password field does not have a max/min length validation. -Adam Rauf Khan wrote: > Hi, > > I am trying to validate a simple form which has a name, password & > email field. I have validated that name field(html:text) should > contain only characters, password field(html:text) contains only > numbers & email field(html:text) should contain proper email id. > > When i enter only numbers in name field, only characters in password > field & an invalid email id then only alert msg "please enter only > characters" > is coming for name field & msg "pls enter only numbers for password > field' *BUT* no msg is coming for email field even though i have > entered a wrong email id. Also those two msgs are coming > simultaneously but i want like this, i mean to say when i click on > submit button first only msg for name field should show. Then again if > i click submit button then msg for password field should show & so on. > > Also suppose if i enter the proper name (only characs) , proper > password (only numbers) & if i enter the invalid email id then it will > show the > msg" please enter a valid email address". > > I am sending the following code for reference : > > Validation.xml > --------------------- > >
> depends="required,mask,minlength,maxlength"> > > > > mask > ^[a-zA-Z]*$ > > > position="1"/> > > minlength > 5 > > > position="2"/> > > maxlength > 6 > > > > > > > mask > ^[0-9]*$ > > > > > position="0"/> > >
> > > MessageResources.properties: > -------------------------------------------------- > #- validations for compose.jsp -- > ComposeForm.fname = Please enter the Name. > ComposeForm.password = Please enter the Password. > ComposeForm.email = Please enter the Email. > ComposeForm.OnlyNumbers = Please enter only numbers > ComposeForm.OnlyChars = Please enter only characters > ComposeForm.InvalidEmail = Please enter a valid Email address. > ComposeForm.OnlyNumbersChars = Please enter only numbers & characters > ComposeForm.fname.minlength = First Name cannot be less than {1} > characters. > ComposeForm.fname.maxlength = First Name cannot be greater than {2} > characters. > > > Thanks in advance. > > Regards > Rauf Khan > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org