WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Apply focus to the input element after right click., Kevin, October 16, 2003
     Re:Apply focus to the input element after right click., JT_Kiwi, October 16, 2003

Subject: Apply focus to the input element after right click. From: Kevin Date: October 16, 2003

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>




Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX