Click to See Complete Forum and Search --> : focus on popup window


rogers
11-11-2003, 05:06 PM
Hi,

I have a window created by window.open()

I want the keyboard focus to be on an entry field in that window. How can that be done?

I tried win.focus() but that did not seem to have any effect.

Thanks

Jona
11-11-2003, 06:28 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled</title>
<script type="text/javascript"><!--
document.onload = function(){document.forms[0].myTBox.focus()};
//--></script>
</head>
<body>
<form action="action.ext" name="myForm"><div>
<input type="text" name="myTBox">
</div></form>
</body></html>


[J]ona

rogers
11-12-2003, 05:06 PM
Hi,

The popup window opens up a flash file, which contains that entry field.

How do I put focus on the field which is actually in a flash file?


Thank you

Jona
11-13-2003, 12:00 PM
The focus of the window is usually automatically on the Flash object, so you'll need to configure that in Flash. I don't have the program, so I'm not really sure how exactly you'd do that, but I've never heard of using JavaScript to set the focus of a textbox in a Flash object. I'm almost certain you should do that in Flash, which has its own programming language konwn as ActionScript...

[J]ona