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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:20:47+00:00 2026-06-13T17:20:47+00:00

I need help with my code: I am dynamically adding elements, creating new elements

  • 0

I need help with my code:

I am dynamically adding elements, creating new elements need these functions have a plugin
called CHOSEN but to create them after creation does not work I tried to rerun the function to add the properties of Chosen to new elements.

ajaxchosen = function () {
    $("select").each(function(index, element){
        $(element).ajaxChosen(
                   { method: "GET", 
                     url: $(element).attr("source"),
                     dataType: "json"
                   }, function(data){ 
                       var terms; 
                       terms = {};
                       $.each(data, function (i, val) {
                           return terms [i] = val;
                       });
                       return terms;
                   });
    });
};

$ (element).closest("form").find(".nested-field:visible:last").append(template.replace(regexp, new_id));
ajaxchosen();
  • 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-13T17:20:49+00:00Added an answer on June 13, 2026 at 5:20 pm

    If you modify the content of a select that has already been transformed using Chosen, you need to call

    $("#form_field").trigger("liszt:updated");
    

    or (depending on what version you are using)

    $("#form_field").trigger("chosen:updated");
    

    after the modification so chosen reloads itself on that select and updates the values. So, you add the values using some ajax directly on the select (not the chosen divs) and then call the method.

    check the docs: http://harvesthq.github.com/chosen/

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

Sidebar

Related Questions

Hie guys i need help with my code. I have a form where a
I need help with my C code. I have a function that sets a
Please i need help, this code below works fine on my localhost, php5.3+ but
I need your help. I am dynamically adding options to a select box using
I have written a piece of code in C#. That is, dynamically adding TextBox
I need help optimizing the code to run faster, unless it is optimized the
Please, I need help with my code: def start(): def start_tkinter(): global main,l main.destroy()
I need help in parsing big Json file: {status:{code:200,text:OK},content:[{proposalId:12536,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, {proposalId:12537,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, {proposalId:12538,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, {proposalId:12539,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, ................[etc] I
I need help to use jConfirm with this existing code (php & Jquery &
Hi need help getting repeated value from give array,below is the code which im

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.