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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:22:04+00:00 2026-05-11T08:22:04+00:00

I am using Jörn Zaefferer’s jquery autocomplete plugin, and I can’t seem to figure

  • 0

I am using Jörn Zaefferer’s jquery autocomplete plugin, and I can’t seem to figure out how to make it work when I clone an autocomplete field. It almost works, in that the cloned autocomplete field displays the choices when the I type in text, but I cannot select items. At first I thought it was a browser-compatibility issue, but it happens in both FF3 and Safari, so I’m guessing there’s a gotcha I’ve missed.

Here is a working example of what I’m doing:

<html> <head> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/> <title>Autocomplete Clone Demo</title> <style> body { margin: 40px; } .hide_element { display: none; } </style> <link rel='stylesheet' href='http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.css' type='text/css' /> <script src='http://code.jquery.com/jquery-latest.js'></script> <script type='text/javascript' src='http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js'></script> <script type='text/javascript'>     function setAutocomplete()     {         var users = [           { name: 'Fred', id: '1' },           { name: 'Barney', id: '2' },           { name: 'Wilma', id: '3' }         ];          $('.user_selector').autocomplete(users,              {                 mustMatch: true,                 matchContains: true,                 minChars: 2,                 formatResult: function(row) { return row.name; },                 formatItem: function(row, i, max) { return row.name; }             }         );     }      var current= 0;      var addParticipantFields = function()      {         current++;         $newParticipant = $('#template').clone(true);         $newParticipant.removeAttr('id');         $newParticipant.removeClass('hide_element');         $prefix = 'extra' + current;         $newParticipant.children('div').children(':input').each(function(i) {             var $currentElem= $(this);             $currentElem.attr('name',$prefix+$currentElem.attr('name'));         });         $newParticipant.appendTo('#participantsField');         setAutocomplete();     }      $(document).ready(function() {         setAutocomplete();         $('#addParticipant').live('click', addParticipantFields);      }); </script>  </head> <body> <h1>Test Autocomplete Cloning</h1> <form id='demo' method='post' action=''> <fieldset id='participantsField'> <label>Participants</label> <div class='participant'>     <input class='user_selector' name='user' size='30'/> </div> </fieldset>  <!-- This is the template for adding extra participants --> <div class='participant hide_element' id='template'>     <input class='user_selector' name='_user' size='30'/> </div>  <p><input type='button' id='addParticipant' value='Add Another Participant'></p> <p><input class='button' type='submit' value='Submit'/></p> </form> </body> </html> 
  • 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. 2026-05-11T08:22:05+00:00Added an answer on May 11, 2026 at 8:22 am

    Make

    $newParticipant = $('#template').clone(true); 

    like so

    $newParticipant = $('#template').clone(); 

    Your example works for me in FF when you don’t clone events on #template.

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

Sidebar

Related Questions

I'm using Jorn Zaefferer's Autocomplete query plugin, http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ I have options set so it
I'm using Jorn Zaefferer's Autocomplete query plugin, http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ Everything seems to be working as
I am using jQuery Autocomplete plugin 1.1 by Joern Zaefferer. Everything works fine on
I am using the jQuery Autocomplete Plugin (by Jörn Zaefferer of jQuery fame). BackEnd
I'm using Jörn Zaefferers autocomplete plugin for jQuery to enable a live search field,
I'm using the Jörn Zaefferer's jQuery autocomplete plugin which works great, except for a
I'm using the fantastic jquery .validate plugin from Jörn Zaefferer at bassistance I'm using
I'm using Jorn Zaefferer's Autocomplete plugin on a couple of different pages. In both
I use Jorn Zaefferer's Autocomplete jQuery plugin which works great except for one thing
I'm using the excellent jquery.validation plugin by Jörn Zaefferer and I was wondering whether

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.