sdsu.html
Class Button

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

public class Button
extends java.lang.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 Summary
static Button checkBox(java.lang.String name, java.lang.String value)
          Returns a checkbox.
static Button hidden(java.lang.String name, java.lang.String value)
          Allows you to embed information in the form which you do not want changed.
 void makeSelected()
          Use on radio buttons and check boxes.
static Button radio(java.lang.String name, java.lang.String value)
          Produces a radio button.
static Button reset(java.lang.String value)
          Produces a button, which will restore the form to its original state if pressed.
static Button submit(java.lang.String value)
          Produces a button, which when pressed sends the contents of the form to the server.
 java.lang.String toString()
          Returns the html button tags in a string for use in a html page
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

checkBox

public static Button checkBox(java.lang.String name,
                              java.lang.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.

radio

public static Button radio(java.lang.String name,
                           java.lang.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.

submit

public static Button submit(java.lang.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.

reset

public static Button reset(java.lang.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

hidden

public static Button hidden(java.lang.String name,
                            java.lang.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

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

toString

public java.lang.String toString()
Returns the html button tags in a string for use in a html page
Specified by:
toString in interface HTML
Overrides:
toString in class java.lang.Object