Home > Mobile >  How can I retrieve the default value for my jsp dropdown item list?
How can I retrieve the default value for my jsp dropdown item list?

Time:01-11

In my JSP page, I'm utilising a Dropdownlist. Table provides the values.

My issue is that the first option in the list is displayed as the dropdown list's default value.

When the page loads, I want (—None—) to be the default setting. What is the best way to achieve this?

Here's where I put my code:

<div >
            <form:label path="Id">Forms:</form:label>
            <form:select path="Id"   items="${forms}" itemValue="id" itemLabel="name"/>
</div>

CodePudding user response:

It worked

       <form:select path="templateId" >
           <form:option value="None" />
           <form:options items="${temps}" itemValue="id" itemLabel="name"/>
         </form:select>
  •  Tags:  
  • Related