The <html:javascript> tag to allow front-end validation based on the xml in
validation.xml. For example the code: <html:javascript
formName=\"logonForm\" dynamicJavascript=\"true\" staticJavascript=\"true\"
/> generates the client side java script for the form \"logonForm\" as
defined in the validation.xml file. The <html:javascript> when added in the
jsp file generates the client site validation script.

On 5/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Suresh,

I think what Liang is using server side validation.,

Please post all the XML config files, JSP for us to debug.

Thanks and regards,
Pazhanikanthan. P (Paz)






"Suresh Babu S" <[EMAIL PROTECTED]>
30/05/2006 04:30 PM
Please respond to "Struts Users Mailing List"


        To:     "Struts Users Mailing List" <user@struts.apache.org>
        cc:
        Subject:        Re: Help:validation is not working with struts1.2


u need to add <html:javascript > tag into ur form.
did u add this ????


On 5/30/06, M.Liang Liu <[EMAIL PROTECTED]> wrote:
>
> I tried to use validator in my struts application and I find a problem
> occurred:
>              The form did not validate itself and the execute method is
> always called.
>
> I active the plug-in in struts-config.xml as following:
>
> > <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
> >         <set-property
> >         property="pathnames"
> >         value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> >     </plug-in>
> >
> and I write the validation.xml as following:
>
> > <?xml version="1.0" encoding="iso-8859-1"?>
> > <!DOCTYPE form-validation PUBLIC
> >           "-//Apache Software Foundation//DTD Commons Validator Rules
> > Configuration 1.0//EN"
> >           "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";>
> > <form-validation>
> >     <global>
> >         <constant>
> >             <constant-name>phone</constant-name>
> >             <constant-value>^\(?(\d{3})\)?[-| ]?(\d{3})[-|
> > ]?(\d{4})$</constant-value>
> >         </constant>
> >         <constant>
> >             <constant-name>zip</constant-name>
> >             <constant-value>^\d{5}\d*$</constant-value>
> >         </constant>
> >     </global>
> >
> >     <!-- ========================= Default Formset
> > ========================= -->
> >     <formset>
> >         <form  name="sForm">
> >             <field  property="name"  depends="required">
> >                 <arg0  key="test.name"/>
> >             </field>
> >
> >         </form>
> >     </formset>
> > </form-validation>
> >
> >
> I write the struts-config.xml as following for mapping
>
> >  <action
> >       attribute="sForm"
> >       input="/form/s.jsp"
> >       name="sForm"
> >       path="/s"
> >       scope="request"
> >       type="com.eam.struts.action.SAction"
> >       validate="true">
> >       <forward name="success" path="/welcome.do" />
> >     </action>
>
>
>
> The form extends the ValidatorForm,
>
> But it does NOT work.
>
> Who can  help me?
>
>
> Thanks a lot.
>
> --
> Why Signature?
>
>


--
-------------------------------
Suresh babu S
Software Engineer
IBM,080-417 72568(Direct)
+91-9886237127
[EMAIL PROTECTED]


_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed
Scanning Services - powered by MessageLabs. For further information
visit http://www.mci.com



*********************************************************************************
Important Note
This email (including any attachments) contains information which is
confidential and may be subject to legal privilege.  If you are not
the intended recipient you must not use, distribute or copy this
email.  If you have received this email in error please notify the
sender immediately and delete this email. Any views expressed in this
email are not necessarily the views of AXA.   Thank you.

**********************************************************************************




--
-------------------------------
Suresh babu S
Software Engineer
IBM,080-417 72568(Direct)
+91-9886237127
[EMAIL PROTECTED]

Reply via email to