--- "Howk, Michael" <[EMAIL PROTECTED]> wrote:
> I've finally got David Winterfeldt's Struts
> Validator working on the server
> side, but it doesn't look like it's working on the
> client side. So I've got
> a couple of questions:
>
> First, how can I be sure whether or not the
> validator is working on the
> client side? I'm assuming that, if the client side
> were working, my app
> wouldn't call the server side validator at all.
It would still call the server side, but you wouldn't
notice it because all the validation would have
already been done on the client.
>
> Second, what am I missing? I've followed the example
> application (with the
> tweaks required to get it to work on my
> environment). So far, I've added the
> tag:
> <validator:javascript
> formName="user.servlet.UserEditForm" page="1"/>
> and the:
> <html:form
> action="/user/servlet/handleusereditform.do"
> onsubmit="return
> validateUserEditForm(this);">
I auto-generate the Javascript method name so it would
actually create validateuser.servlet.UserEditForm for
the method name which isn't a legal method name. I'll
make an optional attribute so you can specify the
method name. It will be posted within an hour or two.
The Javascript will also fail with nested properties
too.
>
> The JSP runs fine, but it seems to skip over the
> client side validation. The
> only thing I can think of is that my onsubmit
> property doesn't quite match
> the formName property, because I need to put some of
> the package name in
> front of the class name (that's how I entered it for
> the logic:xxx tags).
> How do I know which function to use for the onsubmit
> property? Is that the
> problem or am I missing something else? Or do I need
> to setup the
> JavascriptValidatorTag somehow?
You can always look at the source sent to your browser
and see if it created the Javascript code where you
placed the JavascriptValidatorTag. Then you can see
the name of the validation method that was generated.
>
> Thank you,
> Michael Howk
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/