"Alex M" <al*@acm.org> wrote in message
news:ac**************************@posting.google.c om...
I'm trying to use the jakarta struts client side javascript validators
and the validators are working, but they are not showing the popup
messages. I have the message keys defined in the
ApplicationResources.properties file, the propertise file is in the
right location, it is referenced from the struts-config.xml, but still
no messages. For example, submitting a form that violates the
required field validator, just causes it to do nothing but shift focus
to that field, no messages are shown.
Am I missing something?
Do you have all the javascript elements and files in the proper places? I'm
learning Struts now and just tinkered with that feature yesterday. If you
look at the example application that comes with it, you'll see an example of
Javascript validation in their logon.jsp. First of all, the Javascript
itself is specified in validator-rules.xml. You need an <html:javascript>
tag in the file where you want to do the validation as well as a script tag
to include an external js file, staticJavascript.jsp (that's their name for
it). See the example app for this file's contents (it's tiny, not sure how
it does what it does yet). Finally, in the form you want to validate add to
the form tag:
onsubmit="return validateLogonForm(this);"
Or whatever function you want to call. I think that's everything.