From e2f1e09bf06e05fcf5766e1427727f80d164db09 Mon Sep 17 00:00:00 2001 From: eric Date: Wed, 15 Oct 2003 00:16:17 +0000 Subject: [PATCH] Added a 'button' call to make an input button type, which is useful for making things like back buttons, and other onclick wacky things. If you try the onclick javascript back thing with a submit button it just does the submit. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1268 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/velocity/FormTool.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/velocity/FormTool.java b/projects/samskivert/src/java/com/samskivert/velocity/FormTool.java index 039f6429..9f7b35d0 100644 --- a/projects/samskivert/src/java/com/samskivert/velocity/FormTool.java +++ b/projects/samskivert/src/java/com/samskivert/velocity/FormTool.java @@ -1,9 +1,9 @@ // -// $Id: FormTool.java,v 1.9 2003/08/12 18:31:21 eric Exp $ +// $Id: FormTool.java,v 1.10 2003/10/15 00:16:17 eric Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne -// +// // This library is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License as published // by the Free Software Foundation; either version 2.1 of the License, or @@ -177,6 +177,15 @@ public class FormTool "alt=\"" + altText + "\""); } + /** + * Constructs a button input element with the specified parameter name, + * the specified button text, and the specified extra text. + */ + public String button (String name, String text, String extra) + { + return fixedInput("button", name, text, extra); + } + /** * Constructs a hidden element with the specified parameter name where * the value is extracted from the appropriate request parameter.