PDA

View Full Version : Linking to target within window opened by JS


Francofille
12-10-2002, 04:00 PM
I'm trying to open a new window and set the focus on a specific part of the form within it (using JavaScript, of course)...
Can this be done, or am I asking too much? I'm thinking of the HTML "target" parameter which I know can apply within the same document - but is "focus" the right JavaScript term, and if so, can it be used to control a separate window?

Not sure how to do this. Thanks in advance for your help!
Code is attached with the essentials of what I have so far.

J-la

beetle
12-10-2002, 04:20 PM
focus is right. Just do that within the HTML of the popup

<body onload="document.formName.elementName.focus();">

Francofille
12-10-2002, 04:35 PM
Sounds good, and thanks for replying. How can I do this, though, when I have multiple questions on the form? Can I set the focus depending on which question is being answered?

Thanks,

Jen

beetle
12-10-2002, 04:56 PM
Yes, you can do that. It's just one radio button group, right? What is that group's name?

Francofille
12-10-2002, 05:07 PM
No, unfortunately, multiple radio button sets.

Names such as ind_partnrshp, ind_sale, ind_mgmt, etc. which would make more sense if you saw the code. In each of these, if the user clicks "yes", the document "details.htm" will open (and ideally the focus would change in an onClick event, so that if the doc is already open, it will at least take the user to the right textbox in the new form).

Would you like me to more code with the radio buttons, so you can see it?

Thanks again.