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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:07:26+00:00 2026-06-14T19:07:26+00:00

I am using rails3-jquery-autocomplete gem to fetch the autocomplete items from the database along

  • 0

I am using rails3-jquery-autocomplete gem to fetch the autocomplete items from the database along with some extra data that I need to pre-fill a form.

autocomplete :link, :name, :extra_data => [:url, :is_full_screen, :is_auto_trigger, :is_ad, :is_ecommerce]

Everything other than the url are boolean flags (user preferences) that are used to check/uncheck checkboxes and select radio buttons in a form. Even though the gem updates a text field, but it does not automatically update checkboxes and radio buttons. I have already specified :update_elements in form view:

<%= f.autocomplete_field :name, autocomplete_link_path, :update_elements => {:url => '#link_url', :is_auto_trigger => '#link_is_auto_trigger'}

How do I do this? I tried exploring the railsAutocomplete.select javascript event that gets fired when the option is selected, to execute custom js to select checkboxes and radio buttons, but how do I get the data (from sql query) in that event listener? Is their a simpler way to do this?

  • 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-14T19:07:27+00:00Added an answer on June 14, 2026 at 7:07 pm

    I solved this by executing custom javascript to update checkbox/radio on selecting one of the autocomplete options. A javascript event named railsAutocomplete.select is fired on the input field when a value is selected from the autocomplete drop down. The data.item has all the data that you fetched from the databases (including the extra data):

        $('#link_name').bind('railsAutocomplete.select', function(event, data){
          // Custom JS to select radio/checkbox, or do any other complex task
          select_linktype(data.item.linktype);
          select_tracking(data.item.is_ad);
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using 'rails3-jquery-autocomplete' gem, but it doesn't have multi column search, but there is
Is it possible to select DISTINCT values using Rails3 JQuery autocomplete gem?
I'm using the rails3-jquery-autocomplete gem to autocomplete the name of a user, search attribute
I'm using rails3-jquery-autocomplete gem. It works perfectly, but I don't know how to implement
I am using the rails3-jquery-autocomplete gem to autocomplete the a field (product) in a
I'm using auto_complete plugin: https://github.com/crowdint/rails3-jquery-autocomplete I have installed the gem and added require line
In Rails, I'm using rails3-jquery-autocomplete gem to autocomplete the username owner on a photos#edit
I am using the rails3-jquery-autocomplete gem and it works neat when using it for
I'm Using Rails3 and the Unobstrusive Javascript Gem jquery-rails . Remote deletion (without page
Using: jquery3-autocomplete gem at 1.0.5 jquery-rails gem at 1.0.19 mysql2 gem at 0.2.7 The

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.