Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8237103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:21:40+00:00 2026-06-07T19:21:40+00:00

I have a problem at the 2 dropdown lists in my jsp 1- CLASS

  • 0

I have a problem at the 2 dropdown lists in my jsp 1- CLASS 2-SECTION.Both should come from database and if i select a class in the class dropdown list then the corresponding section values are came from the database. Please help by providing the code in jsp.And i am using mysql database
example:

classes sections

class1 sec1_1
class1 sec1_2
class2 sec2_1

  1. Suppose in the class dropdown list value “class1” is selected
  2. Then the section dropdown list gets “sec1_1″,”sec1_2” values from the database

    • I am facing problem at step 2 please give me the code without using the jquery and ajax
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:21:44+00:00Added an answer on June 7, 2026 at 7:21 pm

    MyPage.jsp

    <s:select name="classId" id="class_select" value="classId" list="yourClassList" onchange="classChanged(this.value)"/>
    <s:select id="sec_select" list="yourSecList"/>
    

    Javascript

    function classChanged(value){
      var url="getSectionsOfClass?classId="+value;
      window.location=url;
    }
    

    struts.xml

    <action name="getSectionsOfClass" class="com.xx.action.GetSectionOfClass">
      <result name="success">MyPage.jsp</result>
    </action>
    

    In GetSectionOfClass declare classId , yourClassList and yourSecList(with getter/setter) and populate the lists with your business logic. yourClassList will containd all the classes whereas yourSecList will contain sections based on classId.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have strange problem. I have class which behaves similar dropdown list. package test.view;
I have come into a bit of a problem. I am dynamically updating dropdown
I am facing an issue populating a dropdown list from Enum class values. My
I have a problem with the positioning of a pure css dropdown menu. You
I have a dropdown in my form that has a problem to populate when
I have problem with UIWebView delay when the load image from url. In my
I have problem while loading data into html select when users press or click
I have two dropdown lists: <asp:DropDownList ID=Field_Type runat=server /> <asp:DropDownList ID=Field_SubType runat=server /> Field_Type
I have a problem in C#, Help me please in: I have a dropdown
I want to click a <select> but stop it to show his dropdown list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.