Added action() and submit() which make doing standard things like a hidden
form field named "action" and a submit button named "submit" more convenient. git-svn-id: https://samskivert.googlecode.com/svn/trunk@404 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -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
|
// samskivert library - useful routines for java programs
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -130,6 +130,15 @@ public class FormTool
|
|||||||
return input("password", name, extra, defaultValue);
|
return input("password", name, extra, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a submit element with the name <code>submit</code> 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
|
* Constructs a submit element with the specified parameter name and
|
||||||
* the specified button text.
|
* the specified button text.
|
||||||
@@ -169,6 +178,17 @@ public class FormTool
|
|||||||
return fixedInput("hidden", name, value, "");
|
return fixedInput("hidden", name, value, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a hidden form field named <code>action</code> 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
|
* Constructs a checkbox input field with the specified name and
|
||||||
* default value.
|
* default value.
|
||||||
|
|||||||
Reference in New Issue
Block a user