Joe,

When using a Struts Validator based on the Action name, you usually need to
add the 'method="validateSomeName"' because the Struts Validator wants to
use the exact name in your validation xml file.  In your case, that is
"/Login" which matches your action.  So, change your html:javascript and
html:form along these lines:

<html:form action="/Login.do" focus="emailAddress" onsubmit="return
validateLogin(this)">

<html:javascript formName="/Login" method="validateLogin">

For more details see html:javascript and html:form in the Struts docs:
http://jakarta.apache.org/struts/userGuide/struts-html.html#javascript

Regards,
David

-----Original Message-----
From: Joe Hertz [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 2:37 AM
To: 'David Friedman'
Subject: RE: Validator Backend Issues


Don't laugh. Now I remember the problem I first encountered.

I'm getting a generated javascript function of "validate/Login(form)"

Do I have to escape the slash in the generated js function name or
something to call it?

<html:form action="/Login.do" focus="emailAddress" onsubmit="return
validate/Login(this)">

> -----Original Message-----
> From: David Friedman [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 24, 2003 2:03 AM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: Validator Backend Issues
>
>
> Joe,
>
> Nope.  I was writing to you about that but you found your
> solution faster than I could type (my poor aching fingers at 2AM!).
>
> When you said your 'formName="UserLoginForm"', that suggests
> you're keying off the action's ActionForm name
> 'name='UserLoginForm' for your validation. That's why you
> would use DynaValidatorForm.
>
> Using DynaValidatorActionForm is just like a
> DynaValidatorForm with one
> exception: it validates of the name of the action.  So if
> your action is called /edit.do, it would need a form name of
> '/edit' such as: <form name="/edit">
>       <field ...>
>       ...
>       </field>
> </form>
>
> I also got stuck on this when I first started using the
> Struts Validator.  I hope this explanation helps.
>
> Regards,
> David
>
> -----Original Message-----
> From: Joe Hertz [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 24, 2003 2:07 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Validator Backend Issues
>
>
> Curious. Changing the ActionForm from a
> DynaValidatorActionForm to a DynaValidatorForm gets me
> backend validation.
>
> Have I just stumbled onto a bug?
>
> > -----Original Message-----
> > From: Joe Hertz [mailto:[EMAIL PROTECTED]
> > Sent: Monday, November 24, 2003 1:46 AM
> > To: 'Struts Users Mailing List'
> > Subject: Validator Backend Issues
> >
> >
> > I'm probably misunderstanding this woefully. Hope someone
> can set me
> > straight.
> >
> > For my login, I'm using a UserLoginForm class that extends
> > DynaValidatorActionForm. The Action  class is an extension of
> > DispatchAction (it handles all User related actions).
> >
> > If in my Login.jsp, I remove the <html:javascript
> > formName="UserLoginForm"/> tag,I get no javascript validations
> > happening, which I would expect, but I also find that I *never* get
> > any back end validation checks happening. Nothing shows up
> where the
> > <html:errors /> tag was.
> >
> > Is there something I have to do to get the validator to do
> it's magic
> > outside of the client?
> >
> > -Joe
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to