Robin,

Yes, there is a way, but Struts cannot automatically supply the solution for you. The stumbling block is that you have automatic validation turned on. If you only want to validate on a certain button, first turn automatic validation off. This will prevent Struts from running the validator whenever the request is submitted.

Then inside your Action, you'll have to explicitly determine when it is the appropriate time to run the validation. If you're using the new Struts EventAction(Dispatcher) classes, you can associate certain button s to different methods. Inside the intended action method, you then should invoke the validator based on whatever key you determine.

The validator is based on whatever key you supply. You can choose the key. I like to do "formname(buttonname)" style. So if I have a form called "personForm" and a button called "save", my form key in my validaton files is "personForm(buttonname)".

Paul

robinbajaj wrote:
Hi Folks, My previous post's subject was not clear. So here's a re-phrase of the
problem.
--------
My loyaltyPAge.jsp has two buttons - Exit and continue.

I want the validation to occur only when "Continue" is clicked upon.
But the <html:form in the jsp points to one actionmapping
having "validate=true" - that's why the Struts validation framework tries to validate the input fields regardless of which button is clicked.
Is there some facility provided by the Struts framework to
SKIP the validation when a specific button (Exit) is clicked
and ONLY OCCUR when another button(*Continue) is clicked . ???

I am using inbuild validation framework (validation-<modulename>.xml
and validator-rules.xml etc.) in this case, --------
Thanks for your help,
regards,
robin.

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

Reply via email to