|
-
Setting the focus to an applet in a web page.
I would like to get my applet to automatically get the input focus whenever the web page is loaded, so that keypresses are sent to the applet without having to click on it first. I understand that this is out of the applet's control, but the focus can be set by a script on the page. I have made various attempts at doing this e.g.:
<html>
<head></head>
<body>
<applet ......... etc.>
</applet>
<script language="JavaScript">
document.applets[0].focus();
</script>
</body>
I have also tried placing it in a onLoad event handler, but I've still not been able to get it working. I've tried it in a form, but that didn't work either.
Help much appreciated....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks