struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: html:cancel doesn't perform as advertised
Date Sun, 14 Mar 2004 10:35:25 GMT
The javascript will be output by the html:form tag and it stops 
javascript validation.

The cancel button should look like this:

<input type="submit" name="org.apache.struts.taglib.html.CANCEL" 
value="Cancel" onclick="bCancel=true;" />

The JSP should look like this:

<html:cancel>Cancel or whatever</html:cancel>


Adam

On 03/14/2004 12:56 AM Dean A. Hoover wrote:
> I have an html:form with a
> html:submit and an html:cancel.
> According to the documentation for
> html:cancel:
> 
> "Pressing of this submit button causes
> the action servlet to bypass calling the
> associated form bean validate() method."
> 
> I tried it and it did validation anyway.
> Then I looked at the generated HTML
> and I see:
> 
> <input type="submit" name="method" value="Next">
> <input type="submit" name="method" value="Cancel" onclick="bCancel=true;">
> 
> The only difference I see is the onclick attribute.
> How is that supposed to do anything, given that
> that there isn't any javascript in the file. What am
> I missing here?
> 
> Dean Hoover
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message