struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cvu <>
Subject Please help, donot validate a field when cancel button is click
Date Wed, 25 Jul 2007 14:53:58 GMT

Hi Gurus, please help
Scenario:By pass the validation when cancel button is click.
  I have a start.jsp that has a text field required to be filled and 2
buttons Cancel and submit. The submit button is click I forward it to
finish.jsp but if the cancel button is click then go to welcome.jsp. Right
now if the text field is filled then it go to finished.jsp if it is not
filled then error msg will post next to it. However, when I click the Cancel
button - type button, it requires text field has to be filled but I want to
by pass the validation (why I have to fill up the field when I click the
cancel button?)

I have a validation.xml file like this:
<form name="incomingSecretDocumentForm">
<field property="sentTo" depends="required,maxlength">
    		<arg0 key="" />
    		<arg1 name="maxlength" key="${var:maxlength}"
    			resource="false" />

And the start.jsp like this:
<td align="right" class="FormElementText">
<bean:message key="" />:
<td align="left">
<html:text property="serialNum" styleClass="FormElements"
	maxlength="10" />
<html:errors property="serialNum" header="empty"
	prefix="errors.form.prefix" suffix="errors.form.suffix" />
and the 2 buttons - Cancel is button type, other is Submit type like this:
<td align="center">

<html:submit styleClass="button" property="buttonName">
	 <bean:message key=""/>

Please help 
many thanks
View this message in context:
Sent from the Struts - Dev mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message