If you have an attribute on your form
'org.apache.struts.taglib.html.CANCEL' the validation will not run.

You will, however, need to find out which button (or link) the user
pressed (Back or Cancel) using some other mechanism:
isCancelled(httpServletRequest) simply tests the existence of this
attribute.


Stuart.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 19, 2004 5:34 AM
To: [EMAIL PROTECTED]
Subject: SV: Validation only on SUBMIT but not on BACK

Hi

In the javascript validation routine there is a parameter : bCancel
<<<-Set this to false if you do not want client side validation

as in :

<html:cancel property="cancel" onclick="bCancel=true">
        <bean:message key="button.cancel" />
</html:cancel>

Hermod

-----Opprinnelig melding-----
Fra: Gunnar Schmitz [mailto:[EMAIL PROTECTED]
Sendt: 19. mai 2004 14:20
Til: [EMAIL PROTECTED]
Emne: Validation only on SUBMIT but not on BACK


Hello,

I am using Struts 1.1 on Tomcat 4.1.24. I have a question regarding
validation.

I have a form and validation rules that apply to this form. In my JSP, I
have 
three buttons, namely CANCEL, SUBMIT, BACK (BACK meaning: I will come
back 
later). My problem now is: I want to validate the fields of my form, but
this 
validation should only occur if I press the SUBMIT button. It must not
occur on 
CANCEL or BACK (since it does not make too much sense to force the user
to give 
his address information before returning to the original place he came
from).

Is there a declarative way to skip the validation for the BACK button,
or would 
I really have to write my own validate() method.

Any help is really appreciated.

Thanks,
Gunnar Schmitz




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


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that DnB NOR cannot
accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *


---------------------------------------------------------------------
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