My goal is to retrieve value from database and show in JSP.
Radio button
If the database data is Owner, the Owner radio button will be check. If the database data is Cashier, the Cashier will then be check.
Dropdown list
If the database data is Orange, then the Orange option will be selected.
Below are my codes.
Help will be appreciate. Thanks! :)
Radio button
<input type="radio" name="role" id="Owner" value="Owner" <c:if out='${staff.staffRole} == "Owner"'>checked</c:if>/>
<input type="radio" name="role" id="Cashier" value="Cashier" <c:if out='${staff.staffRole} == "Cashier"'>checked</c:if>/>
Dropdown list
<select class="form-control">
<option>Apple</option>
<option>Orange</option>
<option>Durian</option>
</select>