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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:18:14+00:00 2026-06-08T03:18:14+00:00

I have managed to write a jquery to do the following: Upon selecting a

  • 0

I have managed to write a jquery to do the following:

  • Upon selecting a new item in a Multiple Select, the jquery would load a div item with a particular url and retrieve an Input widget to place it there.

First attach a onChange event to the select widget:

$(document).ready(function () {
  $("#id_deals").change(deal_edit_func);
});

Now send the selected value to the url

function deal_edit_func(e) {
  var item = $('#deal_status')
  var selected = $(e.target).val();
  item.load(
    "/deal_status/" + selected,
    null
  );
  return false;
}

Within the view:

def _deal_status_view(request, deal_id):
    ids = deal_id.split(',')
    deal_status = DealStatus.objects.all()
    variables = RequestContext(request, {'deal_statuses': deal_status, 'ids': ids})
    return render_to_response('_deal_status.html', variables)

_deal_status.html:

<input type="text" value="{{deal_status}}" name="deal_status">

As long as only one item is selected, one input is returned and loaded into the div tag.
That works very nicely.

Now I need to extend this solution to, whenever more than one item are selected multiple inputs shall be returned, instead of just one like above. But this is where I got stuck. How on earth would I achieve this? the html would always be fixed…

Any help would be appreciated,

  • 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-08T03:18:15+00:00Added an answer on June 8, 2026 at 3:18 am

    You can serialize your response to other format (eg xml,json) which can easily be parsed by jquery or javascript. Therefore your view will return multiple serialized objects then your javascript will process the returned objects.

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

Sidebar

Related Questions

I have managed to bring the following output with this query SELECT DISTINCT IF(purchaseproduct_customerid=0,contactperson,vendorname)
I'm quite new to javascript, but have managed to write a working xml function
So far I have managed to write some code that should print the source
I'm pretty new to javascript and jQuery, but I managed to get Trent Richardson's
I am implementing this JQuery UI multiselect from http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ I have managed to get
So far I have managed to write a query to list all the outgoing
After weeks of effort I have managed to write F# programs that use LLVM
I'm trying to write an XMLHttpRequest using the POST method. I have managed to
I have managed to write the below query, which works great. My problem is
I was reading some file IO tutorials for C# and have managed to write

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.