I am designing an Intranet application. In my application I need the focus always be on input text field. I also need to disable the context menu. I am able to achieve all that with the code below. However, when I right click anywhere on the page I loose focus on my input field. The only way I can bring it back if I click anywhere on the page with the left button. How can I keep focus on my input element when I right-click the page?
<html>
<head>
<title></title>
</head>
<body onclick="document.oForm.searchval.focus()" onload="document.oForm.searchval.focus()" oncontextmenu="return false">
<form name="oForm">
<input onblur="this.focus();" type="text" name="searchval" size="20"><br><br>
<input type="text" name="T2" size="20"><br><br>
<button>Test</button>
</form>
</body>
</html>
<html>
<head>
<title></title>
</head>
<body onclick="document.oForm.searchval.focus()" onload="document.oForm.searchval.focus()" oncontextmenu="return false">
<form name="oForm">
<input onblur="this.focus();" type="text" name="searchval" size="20"><br><br>
<input type="text" name="T2" size="20"><br><br>
<button>Test</button>
</form>
</body>
</html>