The option tag

In this section, you will learn about the option tag of Spring form tag library.

The option tag

The option tag

In this section, you will learn about the option tag of Spring form tag library.

This option tag renders an HTML 'option'. Sample code is shown below:

<tr>
	<td>State:</td>
	<td>
		<form:select path="state">
			<form:option value="Delhi"/>
			<form:option value="Maharastra"/>
			<form:option value="Gujraat"/>
			<form:option value="Bihar"/>
		</form:select>
	</td>
</tr>

This will be rendered something like this :

<tr>
	<td>State:</td>
	<td>
		<select path="state">
			<option value="Delhi" selected="selected">Gryffindor</option>
			<option value="Maharastra">Maharastra</option>
			<option value="Gujraat">Gujraat</option>
			<option value="Bihar">Bihar</option>
		</select>
	</td>
</tr>