I have 2 buttons in one form:
<input type="text" id="txtSearch" maxlength="250" placeholder="Enter Search" style="height: 42px; padding-right: 36px;" runat="server" />
<button type="submit" onserverclick="btnSearch_Click" id="btnSearch" runat="server"></button>
<input type="text" id="_searchKeyword" maxlength="250" placeholder="Search Term" style="height: 42px; padding-right: 36px;" runat="server" />
<button type="submit" onserverclick="SearchButton" id="btnSearchNoResult" runat="server">
</button>
My JavaScript:
$("#txtSearch").keyup(function (event) {
if (event.keyCode == 13) {
$("#btnSearch").click();
}
});
$("#_searchKeyword").keyup(function (event) {
if (event.keyCode == 13) {
$("#btnSearchNoResult").click();
}
});
if I type on _searchKeyword input text, and then press Enter button, I get the value of txtSearch input text. How can I get the value of _searchKeyword input text with enter press not value of txtSearch?