0

i am tying to implement the django multi select widget in my app. It works fine. But i need some help to auto-fill the "to" select field with values from the database. Actually i have build a jquery json object of the required data.

  $.each(sport_intrested_obj, function (sport_name, obj) {
    console.log(sport_name) //works fine
    console.log(obj['id']) // works fine
  $('#id_s_sports_assigned_to').append(
          $("<option></option>")
          .attr("value",obj['id'])
          .text(sport_name));
  });

"id_s_sports_assigned_to" is the dropdown where i want to auto populate the details

Nidhin Bose J.
  • 1,092
  • 15
  • 28
  • [http://stackoverflow.com/questions/740195/adding-options-to-a-select-using-jquery-javascript] – Emanuele Paolini Jan 21 '13 at 07:18
  • At what stage are you populating the field? is it populated when the page loads or after the page has loaded? I think you may need to add some info about your django models used to supply the field values. – Aidan Ewen Jan 21 '13 at 07:23

0 Answers0