below is the html input
<input type="text" class="autocomplete" id="search_data" name="search_data" value="" data-link="currency_autocomplete.php" >
this is the jquery i use for autocomplete
$(function() {
$(".autocomplete").autocomplete({
source: 'currency_autocomplete.php',
minLength: 2,
select: function( event, ui ) {
$(this).val(ui.item.value);
return false;}
})
});
the above code is working fine
but i need to update jquery source:
something like below
$(function() {
$(".autocomplete").autocomplete({
source: $(this).attr('data-link'), *** here i need update
minLength: 2,
select: function( event, ui ) {
$(this).val(ui.item.value);
return false;}
})
});