$('#countryField').typeahead(false, {
name: 'country',
valueKey: 'name',
source: function(){
return [
{"id": 1, "name": 'Toronto'},
{"id": 2, "name": 'Montreal'},
{"id": 3, "name": 'New York'},
{"id": 4, "name": 'Buffalo'},
{"id": 5, "name": 'Boston'},
{"id": 6, "name": 'Columbus'},
{"id": 7, "name": 'Dallas'},
{"id": 8, "name": 'Vancouver'},
{"id": 9, "name": 'Seattle'},
{"id": 10, "name": 'Los Angeles'}
];
},
template: [
'<p class="repo-id">{{id}}</p>',
'<p class="repo-name">{{name}}</p>',
].join(''),
engine: Hogan
});
$result = array(
'header' => $header,
'menu' => $menu,
'content' => $content
);
die(json_encode($result));
<script type="text/javascript">
<!--
$.ajax({
url: "/test/query_ajax.php",
data: $("#selections").serialize(),
type: "POST",
dataType: 'json',
}).done(function(data) {
$("#header").html(data.header)
$("#menu").html(data.menu)
$("#content").html(data.content)
}
-->
</script>
<div class="col-sm-12" id="created_<?= $news->id; ?>"></div>
<script type="text/javascript">
<!--
$(function () {
var date = new XDate(<?= $news->created; ?> * 1000).toString('dd MMM yyyy в HH:mm');
$('#created_<?= $news->id; ?>').html(date);
});
-->
</script>
<script src="https://code.jquery.com/jquery-2.1.3.js"></script>
<script type="text/javascript">
<!--
$(function(){
$("#sendForm").click(function(){ // При клике по кнопке #sendForm
if ($("#msprice").val() == '') // Если в элементе #msprice выбрана опция с пустым значением
$("#msprice").remove() // Удаляем #msprice с формы
});
});
-->
</script>
<form role="form" action="catalog/vse-tovaryi/">
<select name="ms|price" id="msprice">
<option value="">Любая</option>
<option value="500">500 рублей</option>
</select>
<select name="msoption|tags">
<option value="1">Тэг 1</option>
<option value="2">Тэг 2</option>
</select>
<button type="submit" id="sendForm">Подобрать</button>
</form>