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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:14:51+00:00 2026-06-09T17:14:51+00:00

My ui-autocomplete should send ajax request to different path’s. My script changes this path

  • 0

My ui-autocomplete should send ajax request to different path’s.
My script changes this path on change select event. But event do not updates and sends request to old url.

I tried live(), on(), livequery(). nothing works.

How to update event?

My input autocomplete field:

<input class="specialization_names ui-autocomplete-input" data-autocomplete-source="/specializations">

I’m changing data-autocomplete-source

Event I’m binging next way(generated by coffeescript)

_ref = $('.specialization_names');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
  input = _ref[_i];
  $(input).on('focus', function() {
    return $(input).catcomplete({
      source: $(input).data('autocomplete-source')
    });
  });
}

or change on() to live() or to plugin livequery

This code changing url on select.

var select, _i, _len, _ref;

_ref = $('.resume_scopes');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
  select = _ref[_i];
  $(select).on('change', function() {
    var scope_id;
    scope_id = $(this).children("option:selected").attr('value');
    return $(this).siblings('.specialization_names').attr("data-autocomplete-source", "/specializations/" + scope_id);
  });
}

Is there any way to manually refresh one time an event?

  • 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-09T17:14:53+00:00Added an answer on June 9, 2026 at 5:14 pm

    jQuery’s .data only reads from the data-* attribute once (the 1st time you call .data on the element to get the value). .attr updates the attribute on the element, but jQuery’s .data has cached the value. It you want to update it, try using .data instead.

    return $(this).siblings('.specialization_names').data("autocomplete-source", "/specializations/" + scope_id);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to make autocomplete for many text input field... but with this autocomplete
Can we use multiple autocomplete extender control on single textbox in asp.net? This should
I am trying to use autocomplete from http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js but am getting this error. textbox
I know we should use JSON when receiving remote autocomplete suggestions, but I'm forced
I currently have a query string for the jQuery Autocomplete plug in but should
Using Rails 3.1.1. & 'rails3-jquery-autocomplete' I think this question should be quite simple for
This should be relatively simple for the MVC experts out there, but I'm still
I'm attempting to customize an autocomplete plugin for jquery. This should be extremely simple.
jQuery autocomplete docs state there should be two Models, the first being the model
with autocomplete javascript: <link rel=stylesheet type=text/css href=j query/js/jquery.autocomplete.css /> <script type=text/javascript src=j query/js/jquery.autocomplete.js></script>{/literal} <script

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.