how do i get the id and not the value of the parameter?
i have a drop down i need to use the folowing to get the id
<select name="<c:out value="${item}"/> SchoolOrg">
<option> Please Select... </option>
<c:forEach var="ed" items="${edd.educations}">
<option id ="<c:out value="${ed.educationid}"/>" name="<c:out value="${ed.schoolorganisation}"/>">
<c:out value="${ed.schoolorganisation}"/>
</option>
</c:forEach>
</select>
i get the value using the following but i want the id instead...?
int educationid = request.getParameter( i +"SchoolOrg");
i changed it to this but it still doesnt work
<select name="<c:out value="${item}"/> SchoolOrg">
<option> Please Select... </option>
<c:forEach var="ed" items="${edd.educations}">
<option value = "<c:out value="${ed.educationid}"/>">
<c:out value="${ed.schoolorganisation}"/>
</option>
</c:forEach>
</select>
and :
int educationid = Integer.parseInt(request.getParameter( i +"SchoolOrg"));
i want the id back not the value of the dropdown
There is no way to get the value of an id attribute in the form of a request parameter as far as the <select> and <option> element is concerned.
If you are on the same page you can do something with Javascript
var someObject = getElementById(Id);
Then with Javascript you might be able to access the id attribute, but I'm not sure about that, and it has to be done on the same page.