When user clikcs enter insid a textbox, I want to triger the submit button click, Ihave the following code but code inside if is not executed. Please help.
<script lang="javascript" type="text/javascript">
window.onload = function () {
document.getElementById("txtUserName").focus();
};
function jftnSubmit(e) {
if (e.keycode == 13) {
alert('d enter f');
var ButtonID = btnLogin.id;
document.getElementById(btnSearchID).click();
}
return false;
}
</script>
<input id="txtUserName" autofocus runat="server" type="text"
class="form-control" placeholder="Username" maxlength="50" onclick="jftnSubmit(event); " />