field tag
This tag renders an input, option, or textarea field. Valid types are text, checkbox, radio, option, textarea, or hidden. Supported in documents.
Attribute |
Notes |
id
|
|
name
|
Required
|
type
|
Required
|
style
|
|
value
|
|
checked
|
|
class
|
|
selected
|
|
test
|
|
disabled
|
|
size
|
|
maxlength
|
|
rows
|
|
cols
|
|
onclick
|
|
onblur
|
|
onchange
|
|
onfocus
|
|
use
|
|
pattern
|
|
custompattern
|
|
readonly
|
|
encrypt
|
|
title
|
|
autocomplete
|
|
autofocus
|
|
height
|
|
list
|
|
max
|
|
min
|
|
placeholder
|
|
required
|
|
step
|
|
width
|
|
spanClass
|
|
show
|
|
Sample:
<select name="mySelect">
<c:field type="option" name="Choice 1" value="choice1" selected="${mySelect=='choice1'}"/>
<c:field type="option" name="Choice 2" value="choice2" selected="${mySelect=='choice2'}"/>
</select>
<c:field type="text" name="firstName" value="${firstName}" disabled="${!admin}"/>
<c:field type="checkbox" name="apples" value="true" checked="${apples=='true'}"/>
<c:field type="text" name="address" class="input" value="${name}" spanClass="other" test="${edit}"/>
<c:field type="checkbox" name="apples" value="true" checked="${apples=='true'}" test="${allowEdit}" show="false"/>