Date: 2004-07-26T10:57:41 Editor: MichaelMcGrady <[EMAIL PROTECTED]> Wiki: Apache Struts Wiki Page: StrutsCatalogMultipleImageButtonsWithNoJavaScript URL: http://wiki.apache.org/struts/StrutsCatalogMultipleImageButtonsWithNoJavaScript
no comment Change Log: ------------------------------------------------------------------------------ @@ -1,9 +1,10 @@ StrutsCatalog: '''Here is one way to take care of that pesky and recurrent problem of how to use multiple image buttons in your forms. This solution will suggest other possibilities you might want to code for yourself.''' -The HTML is simple: +The HTML is simple. If you have buttons you want called "submit" and "clear" for example, you would have the following HTML: {{{ <input type=image name='button.submit' src='Submit.gif'> + <input type=image name='button.clear' src='Clear.gif'> }}} Here's the button I use. @@ -86,6 +87,10 @@ {{{ if([ActionForm].getButton().getSubmit().pressed()) { // do whatever + } else if ([ActionForm].getButton().getClear().pressed()) { + // do whatever + } else { + // some assert code } }}} --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]