I have tried for hours now, to get a variable in my "remote" path. The variable will change, depending on another input. Here is the code:
school_value = $('#school').val();
$('#school').change(function () {
school_value = $(this).val();
$('#programme').typeahead('destroy'); // I have also tried with destroy - but it doesnt work.
});
$('#programme').typeahead({
remote: 'typeahead.php?programme&type=1&school_name=' + school_value,
cache: false,
limit: 10
});
The variable 'school_type' is not set in the remote addr, and therefore not called.
Do you have any clue how to get it working? I have just switched from Bootstrap 2.3 to 3, and then noticed typeahead was deprecated. Above code worked on Bootstrap 2.3, but it seems like when the script is initialized, the remote path is locked.
'
, with no backslash like the rest of your code. – Kenwardschool_type
, which I don't see but assume is some other field you want to include in this request. Yet you say it used to work? Is this about doing something new or fixing something which broke with an update? – Rajewskischool_value = 'testing'
it then works perfectly. But it just wont change, when I type in something in #school. – Federal