David G. Friedman wrote:
Well, first things first ;)I haven't used the validator in a while but I have a 3 questions for you:
1. If, as you say, the Javascript tag isn't being enclosed in <script>..</script> tags, then you need to verify that your validation file is loaded AND that you have the correct form name in your <html:javascript formName="...." />. I've had that problem before when the file either was not loaded (bad path on my part for the plug-in) OR when the formName="..." didn't match anything in my validation.xml file. I recommend you make sure the file loaded properly and is in the correct path specified in your plugIn as you listed a matching formName in that .xml file.
[ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validator-rules.xml'
[ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validation.xml'
I guess this implies that it's been loaded right? Well the name of the form matches both javascript tag and validation.
Sorry, this is what I didn't understand. I thought that the name would be the name of the function declared on the validatior-rules.xml2. Since your html:javascript tag names the form "userForm", why isn't your action tag's onSubmit call this: onsubmit="return validateUserForm(this);"
Well step 3 looks just like above. I'll try other stuff here. But thanks for the help David.3. What does your action mapping look like? I should look a bit like this (depending on how you customized it, of course):
<action path="/atualizaDadosUsuarioAction" name="userForm" type="AAAA" validate="true" input="BBBB" > <forward name="success" path="????" /> </action>
I. The "AAAA" should be the class name of the Action subclass to invoke.
II. The validate="true" forces the server-side to user the userForm's validate() method provided by the super class ValidatorForm. This allows validation failure to go to the place specified in the input="BBBB" attribute for your action in the struts-config.xml (or related Struts module) file.
III. The "BBBB" should be a place to go (JSP, forward, html page, action) to go to when validation fails. Typically, this is some input form page which is often the page calling the "/atualizaDadosUsuarioAction" Struts action in the first place.
Regards, David
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]