I have a dropdown of roles in JSP file. When a role is selected from the dropdown I want to get the selected role ID. When a role is selected then an onchange event occured and a function 'callAjax(roleId) is triggered. Here the roleId is jsp variable. I am trying to pass it through a javascript. But I can not able to do this. Is it really possible? Can any one help me to doing this.
Thanks in advance.
<select name="role" onchange="callAjax(roleId)">
<c:forEach items="${pro.roles}" var="rol" varStatus="status">
<option value="${rol.id}">
<c:out value="${rol.name}"/>
</option>
</c:forEach>
</select>