Reputation: 10703
My jsp code like this,
<form:select path="metaFieldId" cssStyle="width: 190px;" placeholder="Select Filter" onchange="selectMetaField(${metaFieldId})">
<form:option value="" label="" />
<form:options items="${metaFields}" itemLabel="name" itemValue="id" />
</form:select>
Can anybody help my?
Upvotes: 0
Views: 2773
Reputation: 4340
In HTML select
tag does not support placeholder
attribute.
If you use select
you can use the first option to display the placeholder text:
<form:select path="metaFieldId" cssStyle="width: 190px;" onchange="selectMetaField(${metaFieldId})">
<form:option value="" label="Select Filter" />
<form:options items="${metaFields}" itemLabel="name" itemValue="id" />
</form:select>
Upvotes: 6