<input type="text" autocomplete="off" class="Autocomlete1" name="test">
$('.Autocomlete1').typeahead({
ajax: {
url: './test.php?log=test',
triggerLength: 1
},
updater: function(item) {
return item;
},
onSelect: function(item) {
return item;
}
});
After autocomplate in input
we get nextvalue - Text " TextTextText "
(database row have it value) but need output Text " TextTextText "
For replace "
on "
i want make:
onSelect: function(item) {
var text = item.text;
var text = text.replace(/"/g, '"');
$('.Autocomlete1').val(text);
return item;
}
But this is not working...
Tell me please how right replace "
on quotes ?
if not working var text = text.replace(/"/g, '\\"');
check other lines becouse it worked for me.