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 7692309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:49:27+00:00 2026-05-31T20:49:27+00:00

i have two dropdown list. first drop down:1 enter code here <form:select path=custName id=custName>

  • 0

i have two dropdown list.
first drop down:1
enter code here

<form:select path="custName" id="custName">
    <form:option value="walk_in">Walk In</form:option>
    <c:forEach var="led" items="${name}">
        <form:option value="${led.ledName}">${ledger.ledName}</form:option>
    </c:forEach>
</form:select>

second dropdwon :

<form:select path="customerName" id="c01">
        <option value="walk_in">Walk In</option>
        <c:forEach var="led" items="${name}">
        <form:option  value="${led}">
        </form:option>
        </c:forEach>
        </form:select>

I have the following Spring Controller

@Controller
@RequestMapping("/accreq")

with the following mapping

    @RequestMapping(value="/creditAccount_name.htm",method=RequestMethod.GET)
        public @ResponseBody String GetName(@RequestParam(value="credit",required=true)String customername, ModelMap model){
            List<Journal> journals=journalDao.getReceiptTypeName(customername);
            System.out.println(customername);
            String ID = journals.get(0).getJournalId().toString();
            System.out.println(ID);
            return ID;//here i am getting the value in console
        }

I’m trying to call this method with the following jquery ajax

function getAjaxReceipt(){

var custname=$("#custName").val();
if(custname!="walk_in"){
    $.ajax({
        type:'GET',
        url:'creditAccount_name.htm',
        data:{credit:custname},
        success:function(data){
            $('#c01').val(data);//this is the feild id of second drop down value should display here...but is show empty...
            alert(data);//here also i am getting the alertbox in jsp
        },
        error:function(xmlHttpRequest, textStatus, errorThrown){
            if(xmlHttpRequest.readyState=0 || xmlHttpRequest.status == 0)
                return;
        },
    });
}

The Scenario is i am getting the value of first dropdwon through query and binding it in controller.when i select the value of the first dropdown ,its corresponding value should bind in 2nd drop down.

for that i have used ajax and jquery…i am successfully get the value to the controller and passing the valuing to ajax..But the problem is the value is not binding in the dropdown box.
Can any one tell me what might have gone wrong?

The prblem is after the value is displayed in alert…its not showing in second dropdown.?

  • 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-05-31T20:49:28+00:00Added an answer on May 31, 2026 at 8:49 pm

    i am seeing in the second drop down like <form:option value="${led}"></form:option>. You are having the value for that drop down but there is not display label set for that, but for the first drop down you have like <form:option value="${led.ledName}">${ledger.ledrName}</form:option>. Is that something properly done but you are not displaying it right?

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

Sidebar

Related Questions

I have two drop down lists: <select name="branch"> <option value="b">Blacksburg</option> <option value="c">Christiansburg</option> <option value="f">Floyd</option>
There will be two drop down lists, First have the list of mobile vendor,
I have two drop down list on a page. The first one list projects
Currently, I have two drop down lists that are populated with users' first and
I have a web form with two drop-down boxes, and I'm looking for a
I have a 'select' drop-down with a list of players' names, which by default
I have a form on my page which contains two select dropdowns. The first
I have a drop down list with two values (for now..) with other elements
I have a form with two drop down menus and I want the selectable
I have two drop down. SelCurrentManuf and selCurrentModel. I want the option in selCurrentModel

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.