From aca62779cb62268743caa98246b086e48118c39b Mon Sep 17 00:00:00 2001 From: mdb Date: Sat, 9 Nov 2002 00:48:51 +0000 Subject: [PATCH] More imageSubmit() alternatives. git-svn-id: https://samskivert.googlecode.com/svn/trunk@901 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/velocity/FormTool.java | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/velocity/FormTool.java b/projects/samskivert/src/java/com/samskivert/velocity/FormTool.java index c59afe5f..408b471e 100644 --- a/projects/samskivert/src/java/com/samskivert/velocity/FormTool.java +++ b/projects/samskivert/src/java/com/samskivert/velocity/FormTool.java @@ -1,5 +1,5 @@ // -// $Id: FormTool.java,v 1.6 2002/03/05 18:33:16 shaper Exp $ +// $Id: FormTool.java,v 1.7 2002/11/09 00:48:51 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -148,6 +148,35 @@ public class FormTool return fixedInput("submit", name, text, ""); } + /** + * Constructs a image submit element with the specified parameter name + * and image path. + */ + public String imageSubmit (String name, String imagePath) + { + return fixedInput("image", name, "", "src=\"" + imagePath + "\""); + } + + /** + * Constructs a image submit element with the specified parameter name + * and image path. + */ + public String imageSubmit (String name, String value, String imagePath) + { + return fixedInput("image", name, value, "src=\"" + imagePath + "\""); + } + + /** + * Constructs a image submit element with the specified parameter name + * and image path. + */ + public String imageSubmit (String name, String value, String imagePath, + String altText) + { + return fixedInput("image", name, value, "src=\"" + imagePath + "\" " + + "alt=\"" + altText + "\""); + } + /** * Constructs a hidden element with the specified parameter name where * the value is extracted from the appropriate request parameter.