All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sdsu.html.Button

java.lang.Object
   |
   +----sdsu.html.Button

public class Button
extends Object
implements HTML
Creates input buttons for use in an HTML form. Documentation for button types comes in part from Web pages by Arnoud "Galactus" Engelfriet galactus@html.com. See http://www.htmlhelp.com/ Use static methods Button.checkBox(...), Button.radio(...), Button.submit(...) Button.reset(...), Button.hidden(...) to create instances of this class.

Version:
0.8 8 April 1997
Author:
Roger Whitney (whitney@cs.sdsu.edu)

Method Index

 o checkBox(String, String)
Returns a checkbox.
 o hidden(String, String)
Allows you to embed information in the form which you do not want changed.
 o makeSelected()
Use on radio buttons and check boxes.
 o radio(String, String)
Produces a radio button.
 o reset(String)
Produces a button, which will restore the form to its original state if pressed.
 o submit(String)
Produces a button, which when pressed sends the contents of the form to the server.
 o toString()
Returns the html button tags in a string for use in a html page

Methods

 o checkBox
 public static Button checkBox(String name,
                               String value)
Returns a checkbox. Here is an example:
A Checkbox

Parameters:
name - name used to identify button when form is sent, plain text only.
value - value submitted with form if button is checked, plain text only.
 o radio
 public static Button radio(String name,
                            String value)
Produces a radio button. A radio button always exists in a group. All members of this group should have the same NAME attribute, and different VALUEs. The VALUE of the selected radio button will be sent to the server. You can specify CHECKED on one radio button, which then will come up selected initially. An example:
A Radio button

Parameters:
name - name of button created, plain text only.
value - value submitted with form if button is selected, plain text only.
 o submit
 public static Button submit(String value)
Produces a button, which when pressed sends the contents of the form to the server. You can have more than one submit button in the form. Each should have a different NAME. The name and value of the pressed button will be sent to the server as well. The value of the VALUE attribute is typically used as text on the submit button. An example:
A Submit button

Parameters:
value - name displayed in the button. Plain text only.
 o reset
 public static Button reset(String value)
Produces a button, which will restore the form to its original state if pressed. The value of the VALUE attribute is typically used as text on the reset button. An example:
Select Me
A reset button

Parameters:
value - Text shown in button on the form, plain text only
 o hidden
 public static Button hidden(String name,
                             String value)
Allows you to embed information in the form which you do not want changed. This can be useful if the document is generated by a script and you need to store state information. NAME and VALUE of this input field will be sent to the server without modifications.

Parameters:
name - name of button created, plain text only
value - value submitted with form, plain text only
 o makeSelected
 public void makeSelected()
Use on radio buttons and check boxes. This will make the button (box) appear selected when form is displayed. Only one radio button can be selected

 o toString
 public String toString()
Returns the html button tags in a string for use in a html page

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index