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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:06:39+00:00 2026-06-10T05:06:39+00:00

In my page there will be 2 select box [item, and sub-item] <select id=item

  • 0

In my page there will be 2 select box [item, and sub-item]

<select id="item" name="item">
 <option value="1">Desktop</option>
 <option value="2">Laptop</option>
</select>


<select id="sub_item" name="sub_item">
</select>

When ever the user changes the item select-control, an event will send the selected-value to the server using jQuery and the server page will output something like this

DELL,39000
HP,32000

And the jQuery should add those values to the sub-item select box so it changes to

<select id="sub_item" name="sub_item">
 <option value="39000">Dell</option>
 <option value="32000">HP</option>
</select>

Problem: I can’t code how to add/reset the select control for the sub-item

I don’t have any code to share. If you want my SQL or JAVA code I can post it, but I think the backend has nothing to do with the jQuery modifying the sub-item’s value

  • 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-10T05:06:41+00:00Added an answer on June 10, 2026 at 5:06 am
    $.get('URL',function(data){
      //data should be DELL,39000 osv
      var items = data.split("\n");
      items.forEach(function(item){
        item = item.split(',');
        var option = $("<option></option>").text(item[0]).val(item[1]);
        $("sub_item").append(option);
      });
    });
    

    Change ‘URL’ to your url.

    Not tested, but should work.

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

Sidebar

Related Questions

I have a OrganisationName select box in Edit/Add User Page. <s:select key=user.organisationname name=entity.organisationId list=organisationList
is there anyway i could trigger a change event on select box on page
I got the requirement like, In a page there will be 4 panels which
I have a page where there will be many tabs and i want to
I'm writing specs for a page where there will be a Facebook comments plugin
I am making a page in which there will be array of images. I
http://www.designobvio.us/GoldGrid2/ heres a sample page. middle of the screen there will be the content
I have to made a page which will send Email to Newsletter subscribers. There
I have several combo boxes and labels. when a user select any item from
I have a PHP page where a user can select a month and then

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.