PDA

View Full Version : field focus on window focus


autumnnn
10-08-2002, 12:12 PM
Hi,

I have a window with a form text field that focuses the cursor in the field onLoad.

My dilemma however is when this window opens a popup and the user then closes the popup or simply clicks back on the first window the cursor is no loger focused in the field.

Is there any way I can tell the page to set focus to that field everytime the window is in focus?

Thank you kindly
Autumnnn

chrismiceli
10-08-2002, 01:32 PM
if you wanted that you could never change the focus off that field to something like a button to click or something. i don't know how to do it but you could try something like this.

<body onLoad="document.form.input.blah.focus()" onFocus="document.form.input.blah.focus()">

Mr J
10-08-2002, 07:31 PM
In the popup

<script>
function refocus(){
opener.document.formname.imputname.focus()
}
</script>


ADD onunload="refocus()" to the opening BODY tag