【发布时间】:2015-07-15 10:33:08
【问题描述】:
我有一个输入字段,除非您键入/选择某些内容,否则该字段不能让您搜索。我该怎么做呢?
<input type="text" class="form-control pg-csr-customer-search CSRinputBut" aria-label="" id="CustomerSearchText" name="CustomerSearchText" value="" placeholder="Search Customer" required>
当用户点击或敲击回车时,我需要显示此警告。
displayCustomerSearchMessage('<i class=\"fa fa-exclamation-circle pull-left\"></i> Sorry, missing selected Customer Id. Please make a selection from the results listing.', 'warning');
【问题讨论】:
-
向我们展示您的“搜索”事件处理程序...我认为您需要执行
event.preventDefault并在输入为空的情况下显示消息
标签: javascript twitter-bootstrap