Hai Friends,
I have the code like this.
Here my issue is: when the user accesses this page he will get the topic and related categories in the drop down boxes. but when the user changes the topic it needs to populate the categories from the database and kept the topic same for the respective categories. so how can i do this?
<form name="questionForm" method="post" action="listQuestions.lgs">
<table bgcolor="F8D8D8" cellspacing="2" cellpadding="2" align="center"
style="margin-top: 100px">
<tr>
<td>Topics:</td>
<td><select name="topic">
<c:forEach items="${model.topics}" var="topic">
<option value="<c:out value="${topic.topicId}" />"><c:out
value="${topic.topicName}" /></option>
</c:forEach>
</select></td>
<td>Categories:</td>
<td><select name="category">
<c:forEach items="${model.categories}" var="category">
<option value="<c:out value="${category.categoryId}" />"><c:out
value="${category.categoryName}" /></option>
</c:forEach>
</select></td>
<tr>
<td><a
href="addQuestion.lgs?categoryId=2<c:out value="${category.categoryId}"/>">Add
New Question</a></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Questions under this Category:</td>
<td><c:if test="${model.questions} == null">
<c:out value="no questions found" />
<br>
</c:if> <c:if test="${model.questions} != null">
<c:forEach items="${model.questions}" var="question">
<table>
<tr>
<c:out value="${question.questionDesc}" />
</tr>
</table>
</c:forEach>
</c:if></td>
</tr>
<tr>
<td colspan="2"><input type="submit" /></td>
</tr>
</table>
</form>