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

The Archive Base Latest Questions

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

I can’t seem to get autocomplete working with forms that I’m adding to the

  • 0

I can’t seem to get autocomplete working with forms that I’m adding to the screen with javascript. For example, I am using my new route to render my object’s form. Inside my new.js.erb in rails file I have the following:

$("div#container").hide().html("<%= escape_javascript render 'form' %>").fadeIn();

Once rendered, if I type into my input element:

<input id="object_name" name="object[name]" placeholder="Name" size="30" type="text">

And listen with it with javascript:

jQuery ->
  $('input#object_name').autocomplete
    source: ['Test', 'Testing', 'Test 234']

I get nothing as far as autocomplete is concerned. If I copy and paste this form though and have it on the screen at load (and not added dynamically with my rails new path) it will work fine. How do I get autocomplete to listen to things that are added dynamically?

  • 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:21:22+00:00Added an answer on June 13, 2026 at 5:21 pm

    It would appear your autocomplete script is being added before your #object_name form element – if you ensure that you re-define your autocomplete script after #object_name is added to your document all should be well.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Can anyone point me to a simple example of using a CursorLoader to query
can not reproduce deadlock using the next code I am trying yo get a
Can I change the field public virtual ClassOne ClassOne { get; set; } to
Can I authenticate with just Google account username and password instead of using OAuth?
Can any one tell, how to get the result of LINQ query contains group
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Can PHP PDO extension bind nested objects automatically ? I mean using foreign key
Can we change the color of the divider? Apple documentations says, that we can
Can someone please explain why this doesn't work? MyClass myClass1 = new MyClass(); object

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.