diff --git a/projects/samskivert/src/java/com/samskivert/velocity/FormTool.java b/projects/samskivert/src/java/com/samskivert/velocity/FormTool.java index 18adf3e6..0012174b 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.3 2001/11/01 00:28:30 mdb Exp $ +// $Id: FormTool.java,v 1.4 2001/11/01 00:35:05 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -130,6 +130,15 @@ public class FormTool return input("password", name, extra, defaultValue); } + /** + * Constructs a submit element with the name submit and + * the specified button text. + */ + public String submit (String text) + { + return fixedInput("submit", "submit", text, ""); + } + /** * Constructs a submit element with the specified parameter name and * the specified button text. @@ -169,6 +178,17 @@ public class FormTool return fixedInput("hidden", name, value, ""); } + /** + * Generates a hidden form field named action with the + * specified value. This is handy when you have multiple forms + * submitting to the same servlet and you need to distinguist the + * action desired by the user. + */ + public String action (String value) + { + return fixedInput("hidden", "action", value, ""); + } + /** * Constructs a checkbox input field with the specified name and * default value.