我正在修改文本搜索框的一些代码,现在我有以下代码
$categories = maybe_unserialize(get_option('_fm_categories',array()));
$pluginsurl = plugins_url();
$comcat = '';
$sw = 6;
if($cat_view == 'compact') {
$comcat = "<div class='col-md-3'>".'<label for="wpdm-cats-compact">'.__('Category:','wpdmap').'</label>'.wpdm_dropdown_categories('wpdm-cats-compact', '', 'wpdm-cats-compact', 0)."</div>";
$sw = 3;
}
$html = '
<div class=\'w3eden\'>
<form id="srcp" style="margin-bottom: 10px">
<div class="row">
<input type="hidden" name="category" id="initc" value="'.$category.'" />
<span class="col-md-'.$sw.'">
<label for="src">'.__('Search Package','wpdmap').':</label>
<input type="text" class="form-control" name="src" placeholder="'.__('Search Package','wpdmap').'" id="src">
</span>
<a href="#" id="wpdmap-home">Buscar</a>
'.$comcat.'
<span class="col-md-3">
<label for="order_by">'.__('Orden por:','wpdmap').'</label>
<select name="order_by" id="order_by" class="selectpicker">
<option value="date">'.__('Publish Date','wpdmap').'</option>
<option value="modified">'.__('Last Updated','wpdmap').'</option>
<option value="view_count">'.__('View Count','wpdmap').'</option>
<option value="download_count">'.__('Download Count','wpdmap').'</option>
<option value="package_size_b">'.__('Package Size','wpdmap').'</option>
</select>
</span>
<span class="col-md-3">
<label for="order">'.__('Orden:','wpdmap').'</label>
<select name="order" id="order" class="selectpicker">
<option value="DESC">'.__('Descending Order','wpdmap').'</option>
<option value="ASC">'.__('Ascending Order','wpdmap').'</option>
</select>
</span>
</div><br class="clear"/>
</form>
<div class="row">
<div class="col-md-12">
<div class="breadcrumb">
<a href="#" id="wpdmap-home">'.__('Inicio','wpdmap').'</a> <i class="fa fa-angle-right icon icon-angle-right"></i>
<span id="inp">'.__('All Packages','wpdmap').'</span>
</div>
</div>
</div>';
但是当我按Enter键搜索没有任何反应时,我使用带有以下代码的按钮解决了这个问题
<a href="#" id="wpdmap-home">Search</a>
现在,当我单击该按钮时,它可以完美运行,但是现在我希望它在输入文字并按Enter时起作用。