I am trying to implement this jQuery auto complete function but the problem is this i need the value of the previous input field. getting the value from the previous is easy, I just dont know how to add it to the call
the call for the previous value is on top of the document.ready and this doesnt get called when the user types
I NEED to pass it in with this serviceurl like this
song_path(value)
but that fails
$(document).ready(function(){
value = $('#request_artist').val();
$('#song_artist').autocomplete({
serviceUrl: '<%= song_path() %>',
minChars:1,
width: 300,
delimiter: /(,|;)\s*/,
deferRequestBy: 0, //miliseconds
params: { artists: 'Yes' },
});
});
So i basically need something like this
$(document).ready(function(){
$('#song_artist').autocomplete({
serviceUrl: '<%= song_path() %>'$('#request_artist').val(),
minChars:1,
width: 300,
delimiter: /(,|;)\s*/,
deferRequestBy: 0, //miliseconds
params: { artists: 'Yes' },
});
});
but this fails