I have a dropdown
which has three options User
, Instructor
and Player
.
Now i have a table
which displays the list of all users
from the database.
The username
, firstname
, lastname
and a 'change authority' column. This change authority column has the dropdown
with three options 'user', 'player' and 'instructor' and also a save button are present.
Now i want to have the drop down to auto select the authority
of it's user
.
For ex: if A
person has authority
of Player
the dropdown should have player as selected
and
if B
person has authority
as instructor
he should have the corresponding dropdown with instructor selected.
Can anyone help me with this. Thanks.
The initial one was
<select >
<option value="${user[1]}" selected>
<c:out value="${user[1]}" /></option> // this gives the current authority of person from database
<option value="1"> User </option>
<option value="2"> Player </option>
<option value="3"> Instructor </option>
</select>
So, i tried something like
<select>
<option value="1" <c:if test="${user[1] == User}">
</c:if>>User</option>
<option value="2" <c:if test="${user[1] == Player}">
</c:if>> Player </option>
<option value="3" <c:if test="${user[1] == Instructor}">
</c:if>> Instructor</option>