This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic population of second list box based on selection of first

 
Kanuri Phanibabu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have form like this here the issue is :

Dynamic population of second list box based on the selection of first list box.
how can i do this one. please tell me the solution.


<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" onChange="loadCategories()">
<c:forEach items="${model.topics}" var="topic">
<option value="<c ut value="${topic.topicId}" />">
<c ut value="${topic.topicName}" /></option>
</c:forEach>
</select>
</td>
<td>Categories:</td>
<td><select name="category" onChange="loadQuestions()">
<c:forEach items="${model.categories}" var="category">
<option value="<c ut value="${category.categoryId}" />">
<c ut value="${category.categoryName}" /></option>
</c:forEach>
</select>
</td>
<tr>
<td><a
href="addQuestion.lgs?categoryId=2<c ut 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 ut value="no questions found" />
<br>
</c:if> <c:if test="${model.questions} != null">
<c:forEach items="${model.questions}" var="question">
<table>
<tr>
<c ut value="${question.questionDesc}" />
</tr>
</table>
</c:forEach>
</c:if></td>
</tr>
<tr>
<td colspan="2"><input type="submit" /></td>
</tr>
</table>
</form>
[ May 22, 2007: Message edited by: Bear Bibeault ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search for Double Combo or Ajax Double Combo on your favorite search engine or on this site.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When posting code please be sure to do two things:

1) Click the 'disable smilies' checkbox so that your code will look less surprised

2) Use UBB code tags. Please read this for more information.

Also, since this is the HTML forum, showing JSP source code is usually less than helpful. Be sure to show the rendered HTML rather than JSP source.
[ May 22, 2007: Message edited by: Bear Bibeault ]
 
Kanuri Phanibabu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, i will follow the mentioned rules. Thank you for suggesting tips.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome. Easier to read code will mean that more people will look at it and try to help you.

By the way, you can go back and fix you original post by clicking on the icon.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic