31 lines
701 B
JavaScript
31 lines
701 B
JavaScript
$("#genrptbtn").click(function () {
|
|
setTimeout(function () {
|
|
window.location.reload();
|
|
}, 1000)
|
|
});
|
|
|
|
var options = {
|
|
url: "action.php",
|
|
ajaxSettings: {
|
|
dataType: "json",
|
|
method: "GET",
|
|
data: {
|
|
action: "autocomplete_user"
|
|
}
|
|
},
|
|
preparePostData: function (data) {
|
|
data.q = $("#user-box").val();
|
|
return data;
|
|
},
|
|
getValue: function (element) {
|
|
return element.username;
|
|
},
|
|
template: {
|
|
type: "custom",
|
|
method: function (value, item) {
|
|
return item.name + " <i class=\"small\">" + item.username + "</i>";
|
|
}
|
|
}
|
|
};
|
|
|
|
$("#user-box").easyAutocomplete(options); |