Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<body onkeypress="checkKeyCode()">
<script type="text/javascript">
function checkKeyCode() {
//keyCode 13 = enter key
// if enter key was pressed
if (event.keyCode == 13) {
//here check to see if focus is currently in the textarea(s)
if (document.getElementById("textAreaId").focus() {
//do something
}
}
}
</script>
function checkKeyCode(){
//keycode 13 = Enter Key
if (event.keyCode == 13) {
if (document.getElementById('<%=txtAddress.UniqueID %>').focus()){
return true;
} else {
return false;
}
}
}
<script type="text/javascript">
[!]var safeToEnter = 0;[/!]
function checkKeyCode(e) {
//keyCode 13 = enter key
// if enter key was pressed
if (e.keyCode == 13 [!] && safeToEnter[/!]) {
//do something if focus in textarea
}
else {
//do something if focus NOT in textarea
}
}
</script>
<textarea cols="12" rows="12" onfocus="safeToEnter=1" onblur="safeToEnter=0">
blah blah
</textarea>
<body onkeypress="checkKeyCode(event)>