• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynamic population of second list box based on selection of first

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Search for Double Combo or Ajax Double Combo on your favorite search engine or on this site.

Eric
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, i will follow the mentioned rules. Thank you for suggesting tips.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic