aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Dynamic population of second list box based on selection of first Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Dynamic population of second list box based on selection of first" Watch "Dynamic population of second list box based on selection of first" New topic
Author

Dynamic population of second list box based on selection of first

Kanuri Phanibabu
Greenhorn

Joined: May 19, 2007
Posts: 6
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 ]

Thanks and Regards,<br />Phanibabu.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Search for Double Combo or Ajax Double Combo on your favorite search engine or on this site.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kanuri Phanibabu
Greenhorn

Joined: May 19, 2007
Posts: 6
Ok, i will follow the mentioned rules. Thank you for suggesting tips.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic population of second list box based on selection of first