Requirement
- JQuery library
HTML
<div class="input-group search-btn">
<input id="textSearch" type="text" onkeypress="keypressSearch(e);" class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" onclick="return Search();return false;" type="button">SEARCH</button>
</span>
</div>
Javascript
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
function Search() {
var txtField = jQuery("#textSearch").val();
document.location.href = "/Search.aspx?searchtext=" + txtField + "&searchmode=anyword";
return false;
}
function keypressSearch(event) {
if (event.keyCode == 13) {
Search();
return false;
}
else {
}
}
</script>
By Mohd Zulkamal
NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)
0 comments:
Post a Comment