按钮单击搜索总监,按Enter键只能搜索错误
仅用于NoRecord结果,否则将无法正常工作
如果我搜索无记录结果,即使我尝试更正记录也不起作用,它也会再次起作用,请隐藏弹出式表单并提交成功的mgs显示。
这是Enter键功能
$("#app-search").keyup(function (event) {
if (event.keyCode == 13) {
$(".search-pool").click();
}
});
<div class="modal-body">
<div class="row">
<div class="col-md-4 pull-right" id="search-view">
<div class="input-group">
@Html.TextBoxFor(m => m.search, new { id = "app-search", @class = "form-control"})
<a id="btn-clear-search2" class="fa fa-times-circle-o"></a>
<span class="input-group-btn">
<button class="search-pool btn btn-primary" type="button">
<span class="fa fa-search"></span>
</button>
</span>
</div>
</div>
</div>
这是按钮单击功能
$('.search-pool').on('click', function () {
$('#label-error').hide();
$.ajax({
url: '@Url.Action("PoolDetails")',
type: 'GET',
dataType: 'html',
data: { search: $('#app-search').val() }
})
.done(function (responce) {
$('#pool-details').html(responce);
$('#btn-clear-search2').show();
checkSelected();
FillSelected();
})
});