2010-04-14 - Jakarta Taglibs has been retired.

For more information, please explore the Attic.

Jakarta Project: Input Tag library

Version: 1.2

Table of Contents

Overview

The "input" tag extension library lets you present HTML <form> elements that are tied to the ServletRequest that caused the current JSP page to run, or to a JavaBean. That is, using this library, you can easily prepopulate form elements with prior values that the user has chosen -- or with default values for the first time a user hits a web page. This is useful when you need to present the same page to the user several times (e.g., for server-side validation).

You can also automatically build up <select> boxes, making it easier to build data-driven forms. And even if you don't present the same page multiple times, you may want form elements that have default values; this library lets you do that without writing excessive logic.

What is the "Input" tag library? Read more.

Requirements

This custom tag library requires no software other than a servlet container that supports the JavaServer Pages Specification, version 1.1 or higher. Plus any requirements for additional API packages.

Configuration

Follow these steps to configure your web application with this tag library:

To use the tags from this library in your JSP pages, add the following directive at the top of each page:

<%@ taglib uri="http://jakarta.apache.org/taglibs/input-1.2" prefix="input" %>

where "input" is the tag name prefix you wish to use for tags from this library. You can change this value to any prefix you like.

Tag Summary

Input Tags
formCreates a form tag
textDisplays a one-line text-entry box
password Displays a one-line password-entry box
textareaDisplays a multiline textarea
hiddenCreates a hidden form field
selectDisplays a select list
optionDisplays a select option
radioDisplays a radio button
checkboxDisplays a checkbox
 

Tag Reference

form Availability: 1.1

Creates a form tag. See Usage page.

Tag BodyJSP    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 name  No   Yes  1.1
 

form name

 bean  No   Yes  1.1
 

id of the bean to use as the default bean for input elements in the form. If a default bean is set here then it is used for all form elements unless they specify an alternate bean, or specify bean="" which overrides the default bean and specifies not to use a bean.

 method  No   Yes  1.1
 

form method

 action  No   Yes  1.1
 

form action. The url will be passed through response.encodeURL(String) to add session tracking if necessary.

 encodeActionURL  No   Yes  1.2
 

If true, passes the action URL through response.encodeURL(). Defaults to true.

 encType  No   Yes  deprecated
 

form encoding type

 enctype  No   Yes  1.2
 

form encoding type

 onsubmit  No   Yes  1.2
 

onsubmit event handler

 onreset  No   Yes  1.2
 

onreset event handler

 accept  No   Yes  1.2
 

XHTML "accept" attribute

 accept-charset  No   Yes  1.2
 

XHTML "accept-charset" attribute

 id  No   Yes  1.2
 

XHTML "id" attribute

 className  No   Yes  1.2
 

XHTML "class" attribute

 style  No   Yes  1.2
 

XHTML "style" attribute

 title  No   Yes  1.2
 

XHTML "title" attribute

 lang  No   Yes  1.2
 

XHTML "lang" attribute

 dir  No   Yes  1.2
 

XHTML "dir" attribute

 onclick  No   Yes  1.2
 

XHTML "onclick" attribute

 ondblclick  No   Yes  1.2
 

XHTML "ondblclick" attribute

 onmousedown  No   Yes  1.2
 

XHTML "onmousedown" attribute

 onmouseup  No   Yes  1.2
 

XHTML "onmouseup" attribute

 onmouseover  No   Yes  1.2
 

XHTML "onmouseover" attribute

 onmousemove  No   Yes  1.2
 

XHTML "onmousemove" attribute

 onmouseout  No   Yes  1.2
 

XHTML "onmouseout" attribute

 onkeypress  No   Yes  1.2
 

XHTML "onkeypress" attribute

 onkeydown  No   Yes  1.2
 

XHTML "onkeydown" attribute

 onkeyup  No   Yes  1.2
 

XHTML "onkeyup" attribute

 attributes  No   Yes  1.0
 

Custom attributes map of key value pairs

 attributesText  No   Yes  1.1
 

Custom string of attributes to be included in the tag

VariablesNone
ExamplesNone
text Availability: 1.0

Displays a one-line text-entry box. See Usage page.

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 name  Yes   Yes  1.0
 

The "name" of this input element

 default  No   Yes  1.0
 

The default value for this input element. The default value is used if no bean is specified or found, no value is specified and no parameter exists in the request matching the name of this input element.

 value  No   Yes  1.2
 

The value for this input element. The value is used if no bean is specified or if the bean doesn't exist. The value overrides any request parameters or default value, even if the value is null. Unless you require this functionality it is recommended that you use the "default" attribute instead so that the form can autopopulate from the request parameters.

 bean  No   Yes  1.1
 

id of the bean to get the value for this tag from. If no bean exists with that name, a value is used from the request or from the default value. If a default bean is specified by an enclosing form tag, this attribute overrides it. If you set this attribute to the empty string it overrides the default bean and doesn't use any bean.

 id  No   Yes  1.2
 

XHTML "id" attribute

 className  No   Yes  1.2
 

XHTML "class" attribute

 style  No   Yes  1.2
 

XHTML "style" attribute

 title  No   Yes  1.2
 

XHTML "title" attribute

 lang  No   Yes  1.2
 

XHTML "lang" attribute

 dir  No   Yes  1.2
 

XHTML "dir" attribute

 onclick  No   Yes  1.2
 

XHTML "onclick" attribute

 ondblclick  No   Yes  1.2
 

XHTML "ondblclick" attribute

 onmousedown  No   Yes  1.2
 

XHTML "onmousedown" attribute

 onmouseup  No   Yes  1.2
 

XHTML "onmouseup" attribute

 onmouseover  No   Yes  1.2
 

XHTML "onmouseover" attribute

 onmousemove  No   Yes  1.2
 

XHTML "onmousemove" attribute

 onmouseout  No   Yes  1.2
 

XHTML "onmouseout" attribute

 onkeypress  No   Yes  1.2
 

XHTML "onkeypress" attribute

 onkeydown  No   Yes  1.2
 

XHTML "onkeydown" attribute

 onkeyup  No   Yes  1.2
 

XHTML "onkeyup" attribute

 accesskey  No   Yes  1.2
 

XHTML "accesskey" attribute

 tabindex  No   Yes  1.2
 

XHTML "tabindex" attribute

 onfocus  No   Yes  1.2
 

XHTML "onfocus" attribute

 onblur  No   Yes  1.2
 

XHTML "onblur" attribute

 disabled  No   Yes  1.2
 

XHTML Input tag "disabled" attribute: true/false

 readonly  No   Yes  1.2
 

XHTML Input tag "readonly" attribute: true/false

 size  No   Yes  1.2
 

size of the input tag

 maxlength  No   Yes  1.2
 

maxlength of the input tag

 src  No   Yes  1.2
 

src of the input tag

 alt  No   Yes  1.2
 

alt of the input tag

 usemap  No   Yes  1.2
 

usemap of the input tag

 onselect  No   Yes  1.2
 

XHTML Input tag "onselect" attribute

 onchange  No   Yes  1.2
 

XHTML Input tag "onchange" attribute

 accept  No   Yes  1.2
 

XHTML Input tag "accept" attribute

 attributes  No   Yes  1.0
 

Custom attributes map of key value pairs

 attributesText  No   Yes  1.1
 

Custom string of attributes to be included in the tag

VariablesNone
ExamplesNone
password Availability: 1.1

Displays a one-line password-entry box. See Usage page.

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 name  Yes   Yes  1.0
 

The "name" of this input element

 default  No   Yes  1.0
 

The default value for this input element. The default value is used if no bean is specified or found, no value is specified and no parameter exists in the request matching the name of this input element.

 value  No   Yes  1.2
 

The value for this input element. The value is used if no bean is specified or if the bean doesn't exist. The value overrides any request parameters or default value, even if the value is null. Unless you require this functionality it is recommended that you use the "default" attribute instead so that the form can autopopulate from the request parameters.

 bean  No   Yes  1.1
 

id of the bean to get the value for this tag from. If no bean exists with that name, a value is used from the request or from the default value. If a default bean is specified by an enclosing form tag, this attribute overrides it. If you set this attribute to the empty string it overrides the default bean and doesn't use any bean.

 id  No   Yes  1.2
 

XHTML "id" attribute

 className  No   Yes  1.2
 

XHTML "class" attribute

 style  No   Yes  1.2
 

XHTML "style" attribute

 title  No   Yes  1.2
 

XHTML "title" attribute

 lang  No   Yes  1.2
 

XHTML "lang" attribute

 dir  No   Yes  1.2
 

XHTML "dir" attribute

 onclick  No   Yes  1.2
 

XHTML "onclick" attribute

 ondblclick  No   Yes  1.2
 

XHTML "ondblclick" attribute

 onmousedown  No   Yes  1.2
 

XHTML "onmousedown" attribute

 onmouseup  No   Yes  1.2
 

XHTML "onmouseup" attribute

 onmouseover  No   Yes  1.2
 

XHTML "onmouseover" attribute

 onmousemove  No   Yes  1.2
 

XHTML "onmousemove" attribute

 onmouseout  No   Yes  1.2
 

XHTML "onmouseout" attribute

 onkeypress  No   Yes  1.2
 

XHTML "onkeypress" attribute

 onkeydown  No   Yes  1.2
 

XHTML "onkeydown" attribute

 onkeyup  No   Yes  1.2
 

XHTML "onkeyup" attribute

 accesskey  No   Yes  1.2
 

XHTML "accesskey" attribute

 tabindex  No   Yes  1.2
 

XHTML "tabindex" attribute

 onfocus  No   Yes  1.2
 

XHTML "onfocus" attribute

 onblur  No   Yes  1.2
 

XHTML "onblur" attribute

 disabled  No   Yes  1.2
 

XHTML Input tag "disabled" attribute: true/false

 readonly  No   Yes  1.2
 

XHTML Input tag "readonly" attribute: true/false

 size  No   Yes  1.2
 

size of the input tag

 maxlength  No   Yes  1.2
 

maxlength of the input tag

 src  No   Yes  1.2
 

src of the input tag

 alt  No   Yes  1.2
 

alt of the input tag

 usemap  No   Yes  1.2
 

usemap of the input tag

 onselect  No   Yes  1.2
 

XHTML Input tag "onselect" attribute

 onchange  No   Yes  1.2
 

XHTML Input tag "onchange" attribute

 accept  No   Yes  1.2
 

XHTML Input tag "accept" attribute

 attributes  No   Yes  1.0
 

Custom attributes map of key value pairs

 attributesText  No   Yes  1.1
 

Custom string of attributes to be included in the tag

VariablesNone
ExamplesNone
textarea Availability: 1.0

Displays a multi-line text-entry box. The body of the textarea tag will be used as the default value if the default attribute is not provided. See Usage page.

Tag BodyJSP    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 name  Yes   Yes  1.0
 

The "name" of this input element

 default  No   Yes  1.0
 

The default value for this input element. The default value is used if no bean is specified or found, no value is specified and no parameter exists in the request matching the name of this input element.

 value  No   Yes  1.2
 

The value for this input element. The value is used if no bean is specified or if the bean doesn't exist. The value overrides any request parameters or default value, even if the value is null. Unless you require this functionality it is recommended that you use the "default" attribute instead so that the form can autopopulate from the request parameters.

 bean  No   Yes  1.1
 

id of the bean to get the value for this tag from. If no bean exists with that name, a value is used from the request or from the default value. If a default bean is specified by an enclosing form tag, this attribute overrides it. If you set this attribute to the empty string it overrides the default bean and doesn't use any bean.

 cols  No   Yes  1.1
 

the number of columns in the text area

 rows  No   Yes  1.1
 

the number of rows in the text area

 id  No   Yes  1.2
 

XHTML "id" attribute

 className  No   Yes  1.2
 

XHTML "class" attribute

 style  No   Yes  1.2
 

XHTML "style" attribute

 title  No   Yes  1.2
 

XHTML "title" attribute

 lang  No   Yes  1.2
 

XHTML "lang" attribute

 dir  No   Yes  1.2
 

XHTML "dir" attribute

 onclick  No   Yes  1.2
 

XHTML "onclick" attribute

 ondblclick  No   Yes  1.2
 

XHTML "ondblclick" attribute

 onmousedown  No   Yes  1.2
 

XHTML "onmousedown" attribute

 onmouseup  No   Yes  1.2
 

XHTML "onmouseup" attribute

 onmouseover  No   Yes  1.2
 

XHTML "onmouseover" attribute

 onmousemove  No   Yes  1.2
 

XHTML "onmousemove" attribute

 onmouseout  No   Yes  1.2
 

XHTML "onmouseout" attribute

 onkeypress  No   Yes  1.2
 

XHTML "onkeypress" attribute

 onkeydown  No   Yes  1.2
 

XHTML "onkeydown" attribute

 onkeyup  No   Yes  1.2
 

XHTML "onkeyup" attribute

 accesskey  No   Yes  1.2
 

XHTML "accesskey" attribute

 tabindex  No   Yes  1.2
 

XHTML "tabindex" attribute

 onfocus  No   Yes  1.2
 

XHTML "onfocus" attribute

 onblur  No   Yes  1.2
 

XHTML "onblur" attribute

 disabled  No   Yes  1.1
 

HTML textarea tag "disabled" attribute: true/false

 readonly  No   Yes  1.1
 

HTML textarea tag "readonly" attribute: true/false

 onselect  No   Yes  1.1
 

HTML textarea tag "onselect" attribute

 onchange  No   Yes  1.1
 

HTML textarea tag "onchange" attribute

 attributes  No   Yes  1.0
 

Custom attributes map of key value pairs

 attributesText  No   Yes  1.1
 

Custom string of attributes to be included in the tag

VariablesNone
ExamplesNone
hidden Availability: 1.1

Creates a hidden form field. See Usage page.

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 name  Yes   Yes  1.0
 

The "name" of this input element

 default  No   Yes  1.0
 

The default value for this input element. The default value is used if no bean is specified or found, no value is specified and no parameter exists in the request matching the name of this input element.

 value  No   Yes  1.2
 

The value for this input element. The value is used if no bean is specified or if the bean doesn't exist. The value overrides any request parameters or default value, even if the value is null. Unless you require this functionality it is recommended that you use the "default" attribute instead so that the form can autopopulate from the request parameters.

 bean  No   Yes  1.1
 

id of the bean to get the value for this tag from. If no bean exists with that name, a value is used from the request or from the default value. If a default bean is specified by an enclosing form tag, this attribute overrides it. If you set this attribute to the empty string it overrides the default bean and doesn't use any bean.

 id  No   Yes  1.2
 

XHTML "id" attribute

 className  No   Yes  1.2
 

XHTML "class" attribute

 style  No   Yes  1.2
 

XHTML "style" attribute

 title  No   Yes  1.2
 

XHTML "title" attribute

 lang  No   Yes  1.2
 

XHTML "lang" attribute

 dir  No   Yes  1.2
 

XHTML "dir" attribute

 onclick  No   Yes  1.2
 

XHTML "onclick" attribute

 ondblclick  No   Yes  1.2
 

XHTML "ondblclick" attribute

 onmousedown  No   Yes  1.2
 

XHTML "onmousedown" attribute

 onmouseup  No   Yes  1.2
 

XHTML "onmouseup" attribute

 onmouseover  No   Yes  1.2
 

XHTML "onmouseover" attribute

 onmousemove  No   Yes  1.2
 

XHTML "onmousemove" attribute

 onmouseout  No   Yes  1.2
 

XHTML "onmouseout" attribute

 onkeypress  No   Yes  1.2
 

XHTML "onkeypress" attribute

 onkeydown  No   Yes  1.2
 

XHTML "onkeydown" attribute

 onkeyup  No   Yes  1.2
 

XHTML "onkeyup" attribute

 accesskey  No   Yes  1.2
 

XHTML "accesskey" attribute

 tabindex  No   Yes  1.2
 

XHTML "tabindex" attribute

 onfocus  No   Yes  1.2
 

XHTML "onfocus" attribute

 onblur  No   Yes  1.2
 

XHTML "onblur" attribute

 disabled  No   Yes  1.2
 

XHTML Input tag "disabled" attribute: true/false

 readonly  No   Yes  1.2
 

XHTML Input tag "readonly" attribute: true/false

 size  No   Yes  1.2
 

size of the input tag

 maxlength  No   Yes  1.2
 

maxlength of the input tag

 src  No   Yes  1.2
 

src of the input tag

 alt  No   Yes  1.2
 

alt of the input tag

 usemap  No   Yes  1.2
 

usemap of the input tag

 onselect  No   Yes  1.2
 

XHTML Input tag "onselect" attribute

 onchange  No   Yes  1.2
 

XHTML Input tag "onchange" attribute

 accept  No   Yes  1.2
 

XHTML Input tag "accept" attribute

 attributes  No   Yes  1.0
 

Custom attributes map of key value pairs

 attributesText  No   Yes  1.1
 

Custom string of attributes to be included in the tag

VariablesNone
ExamplesNone
select Availability: 1.0

Displays a select list. See Usage page.

Tag BodyJSP    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 name  Yes   Yes  1.0
 

The "name" of this input element

 default  No   Yes  1.0
 

The default value for this input element. The default value is used if no bean is specified or found, no value is specified and no parameter exists in the request matching the name of this input element.

 defaults  No   Yes  1.0
 

The default and defaults attributes for select are concatenated together (if they are both specified). The defaults attribute may be a String[], Map or Collection.

 selectedValue  No   Yes  1.2
 

The selected value for this select box. The value is used if no bean is specified or if the bean doesn't exist. The value overrides any request parameters or default value, even if the value is null. Unless you require this functionality it is recommended that you use the "default" attribute instead so that the form can autopopulate from the request parameters.

 selectedValues  No   Yes  1.2
 

As for "selectedValue" but takes an array of values. If both "selectedValue" and "selectedValues" are provided they are concatenated.

 bean  No   Yes  1.1
 

id of the bean to get the value for this tag from. If no bean exists with that name, a value is used from the request or from the default value. If a default bean is specified by an enclosing form tag, this attribute overrides it. If you set this attribute to the empty string it overrides the default bean and doesn't use any bean.

 multiple  No   Yes  1.1
 

whether multiple choices are permitted by the select box (true|false)

 size  No   Yes  1.1
 

select box size

 options  No   Yes  1.0
 

options map for select. The key is the option label and the value is the option value. Suggest using a java.util.LinkedHashMap so that you can control the order of keys.

 optionsValueLabel  No   Yes  1.2
 

options map for select. The key is the option value and the value is the option label. This is the opposite way around to the options attribute. Suggest using a java.util.LinkedHashMap so that you can control the order of keys.

 optionLabels  No   Yes  1.1
 

options labels for select

 optionValues  No   Yes  1.1
 

options values for select

 disabled  No   Yes  1.2
 

HTML select tag "disabled" attribute: true/false

 id  No   Yes  1.2
 

XHTML "id" attribute

 className  No   Yes  1.2
 

XHTML "class" attribute

 style  No   Yes  1.2
 

XHTML "style" attribute

 title  No   Yes  1.2
 

XHTML "title" attribute

 lang  No   Yes  1.2
 

XHTML "lang" attribute

 dir  No   Yes  1.2
 

XHTML "dir" attribute

 onclick  No   Yes  1.2
 

XHTML "onclick" attribute

 ondblclick  No   Yes  1.2
 

XHTML "ondblclick" attribute

 onmousedown  No   Yes  1.2
 

XHTML "onmousedown" attribute

 onmouseup  No   Yes  1.2
 

XHTML "onmouseup" attribute

 onmouseover  No   Yes  1.2
 

XHTML "onmouseover" attribute

 onmousemove  No   Yes  1.2
 

XHTML "onmousemove" attribute

 onmouseout  No   Yes  1.2
 

XHTML "onmouseout" attribute

 onkeypress  No   Yes  1.2
 

XHTML "onkeypress" attribute

 onkeydown  No   Yes  1.2
 

XHTML "onkeydown" attribute

 onkeyup  No   Yes  1.2
 

XHTML "onkeyup" attribute

 tabindex  No   Yes  1.2
 

XHTML "tabindex" attribute

 onfocus  No   Yes  1.2
 

XHTML "onfocus" attribute

 onblur  No   Yes  1.2
 

XHTML "onblur" attribute

 onchange  No   Yes  1.2
 

HTML select tag "onchange" attribute

 attributes  No   Yes  1.0
 

Custom attributes map of key value pairs

 attributesText  No   Yes  1.1
 

Custom string of attributes to be included in the tag

VariablesNone
ExamplesNone
option Availability: 1.1

Displays a select option. The body of the option tag becomes the label of the option. If the value attribute is not provided then the body also becomes the value of the option. See Usage page.

Tag BodyJSP    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 value  No   Yes  1.1
 

the option value

 disabled  No   Yes  1.1
 

HTML select tag "disabled" attribute: true/false

 id  No   Yes  1.2
 

XHTML "id" attribute

 className  No   Yes  1.2
 

XHTML "class" attribute

 style  No   Yes  1.2
 

XHTML "style" attribute

 title  No   Yes  1.2
 

XHTML "title" attribute

 lang  No   Yes  1.2
 

XHTML "lang" attribute

 dir  No   Yes  1.2
 

XHTML "dir" attribute

 onclick  No   Yes  1.2
 

XHTML "onclick" attribute

 ondblclick  No   Yes  1.2
 

XHTML "ondblclick" attribute

 onmousedown  No   Yes  1.2
 

XHTML "onmousedown" attribute

 onmouseup  No   Yes  1.2
 

XHTML "onmouseup" attribute

 onmouseover  No   Yes  1.2
 

XHTML "onmouseover" attribute

 onmousemove  No   Yes  1.2
 

XHTML "onmousemove" attribute

 onmouseout  No   Yes  1.2
 

XHTML "onmouseout" attribute

 onkeypress  No   Yes  1.2
 

XHTML "onkeypress" attribute

 onkeydown  No   Yes  1.2
 

XHTML "onkeydown" attribute

 onkeyup  No   Yes  1.2
 

XHTML "onkeyup" attribute

 attributes  No   Yes  1.0
 

Custom attributes map of key value pairs

 attributesText  No   Yes  1.1
 

Custom string of attributes to be included in the tag

VariablesNone
ExamplesNone
radio Availability: 1.0

Displays a radio button. See Usage page.

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 name  Yes   Yes  1.0
 

The "name" of this input element

 default  No   Yes  1.0
 

The default value for this input element. The default value is used if no bean is specified or found, no value is specified and no parameter exists in the request matching the name of this input element.

 value  Yes   Yes  1.0
 

value can be empty, but it must be present

 checked  No   Yes  1.2
 

Whether this input element should be checked or not. This overrides the checkedValue and all other means of determining whether the element is checked or not.

 currentValue  No   Yes  1.2
 

If the currentValue matches the value of this input element then the element is checked. The value is used if no bean is specified or if the bean doesn't exist. The currentValue overrides any request parameters or default value, even if the currentValue is null. Unless you require this functionality it is recommended that you use the "default" attribute instead so that the form can autopopulate from the request parameters.

 bean  No   Yes  1.1
 

id of the bean to get the value for this tag from. If no bean exists with that name, a value is used from the request or from the default value. If a default bean is specified by an enclosing form tag, this attribute overrides it. If you set this attribute to the empty string it overrides the default bean and doesn't use any bean.

 id  No   Yes  1.2
 

XHTML "id" attribute

 className  No   Yes  1.2
 

XHTML "class" attribute

 style  No   Yes  1.2
 

XHTML "style" attribute

 title  No   Yes  1.2
 

XHTML "title" attribute

 lang  No   Yes  1.2
 

XHTML "lang" attribute

 dir  No   Yes  1.2
 

XHTML "dir" attribute

 onclick  No   Yes  1.2
 

XHTML "onclick" attribute

 ondblclick  No   Yes  1.2
 

XHTML "ondblclick" attribute

 onmousedown  No   Yes  1.2
 

XHTML "onmousedown" attribute

 onmouseup  No   Yes  1.2
 

XHTML "onmouseup" attribute

 onmouseover  No   Yes  1.2
 

XHTML "onmouseover" attribute

 onmousemove  No   Yes  1.2
 

XHTML "onmousemove" attribute

 onmouseout  No   Yes  1.2
 

XHTML "onmouseout" attribute

 onkeypress  No   Yes  1.2
 

XHTML "onkeypress" attribute

 onkeydown  No   Yes  1.2
 

XHTML "onkeydown" attribute

 onkeyup  No   Yes  1.2
 

XHTML "onkeyup" attribute

 accesskey  No   Yes  1.2
 

XHTML "accesskey" attribute

 tabindex  No   Yes  1.2
 

XHTML "tabindex" attribute

 onfocus  No   Yes  1.2
 

XHTML "onfocus" attribute

 onblur  No   Yes  1.2
 

XHTML "onblur" attribute

 disabled  No   Yes  1.2
 

XHTML Input tag "disabled" attribute: true/false

 readonly  No   Yes  1.2
 

XHTML Input tag "readonly" attribute: true/false

 size  No   Yes  1.2
 

size of the input tag

 maxlength  No   Yes  1.2
 

maxlength of the input tag

 src  No   Yes  1.2
 

src of the input tag

 alt  No   Yes  1.2
 

alt of the input tag

 usemap  No   Yes  1.2
 

usemap of the input tag

 onselect  No   Yes  1.2
 

XHTML Input tag "onselect" attribute

 onchange  No   Yes  1.2
 

XHTML Input tag "onchange" attribute

 accept  No   Yes  1.2
 

XHTML Input tag "accept" attribute

 attributes  No   Yes  1.0
 

Custom attributes map of key value pairs

 attributesText  No   Yes  1.1
 

Custom string of attributes to be included in the tag

VariablesNone
ExamplesNone
checkbox Availability: 1.0

Displays a checkbox. See Usage page.

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 name  Yes   Yes  1.0
 

The "name" of this input element

 default  No   Yes  1.0
 

The two "defaults" for checkbox are concatenated together to form an array of size (defaults.length + 1), or 1 if defaults.length is null or isn't present

 defaults  No   Yes  1.0
 

The two "defaults" for checkbox are concatenated together to form an array of size (defaults.length + 1), or 1 if defaults.length is null or isn't present

 value  Yes   Yes  1.0
 

value can be explicitly empty, or it can be absent, in which case it defaults to "on"

 checked  No   Yes  1.2
 

Whether this input element should be checked or not. This overrides the checkedValue and all other means of determining whether the element is checked or not.

 currentValue  No   Yes  1.2
 

If the currentValue matches the value of this input element then the element is checked. The value is used if no bean is specified or if the bean doesn't exist. The currentValue overrides any request parameters or default value, even if the currentValue is null. Unless you require this functionality it is recommended that you use the "default" attribute instead so that the form can autopopulate from the request parameters.

 currentValues  No   Yes  1.2
 

As for "currentValue" but takes an array of values. If both "currentValue" and "currentValues" are provided they are concatenated.

 bean  No   Yes  1.1
 

id of the bean to get the value for this tag from. If no bean exists with that name, a value is used from the request or from the default value. If a default bean is specified by an enclosing form tag, this attribute overrides it. If you set this attribute to the empty string it overrides the default bean and doesn't use any bean.

 id  No   Yes  1.2
 

XHTML "id" attribute

 className  No   Yes  1.2
 

XHTML "class" attribute

 style  No   Yes  1.2
 

XHTML "style" attribute

 title  No   Yes  1.2
 

XHTML "title" attribute

 lang  No   Yes  1.2
 

XHTML "lang" attribute

 dir  No   Yes  1.2
 

XHTML "dir" attribute

 onclick  No   Yes  1.2
 

XHTML "onclick" attribute

 ondblclick  No   Yes  1.2
 

XHTML "ondblclick" attribute

 onmousedown  No   Yes  1.2
 

XHTML "onmousedown" attribute

 onmouseup  No   Yes  1.2
 

XHTML "onmouseup" attribute

 onmouseover  No   Yes  1.2
 

XHTML "onmouseover" attribute

 onmousemove  No   Yes  1.2
 

XHTML "onmousemove" attribute

 onmouseout  No   Yes  1.2
 

XHTML "onmouseout" attribute

 onkeypress  No   Yes  1.2
 

XHTML "onkeypress" attribute

 onkeydown  No   Yes  1.2
 

XHTML "onkeydown" attribute

 onkeyup  No   Yes  1.2
 

XHTML "onkeyup" attribute

 accesskey  No   Yes  1.2
 

XHTML "accesskey" attribute

 tabindex  No   Yes  1.2
 

XHTML "tabindex" attribute

 onfocus  No   Yes  1.2
 

XHTML "onfocus" attribute

 onblur  No   Yes  1.2
 

XHTML "onblur" attribute

 disabled  No   Yes  1.2
 

XHTML Input tag "disabled" attribute: true/false

 readonly  No   Yes  1.2
 

XHTML Input tag "readonly" attribute: true/false

 size  No   Yes  1.2
 

size of the input tag

 maxlength  No   Yes  1.2
 

maxlength of the input tag

 src  No   Yes  1.2
 

src of the input tag

 alt  No   Yes  1.2
 

alt of the input tag

 usemap  No   Yes  1.2
 

usemap of the input tag

 onselect  No   Yes  1.2
 

XHTML Input tag "onselect" attribute

 onchange  No   Yes  1.2
 

XHTML Input tag "onchange" attribute

 accept  No   Yes  1.2
 

XHTML Input tag "accept" attribute

 attributes  No   Yes  1.0
 

Custom attributes map of key value pairs

 attributesText  No   Yes  1.1
 

Custom string of attributes to be included in the tag

VariablesNone
ExamplesNone

Examples

See the example application input-examples.war for examples of the usage of the tags from this custom tag library.

Java Docs

Java programmers can view the java class documentation for this tag library as javadocs.

Revision History

Review the complete revision history of this tag library.