writing to a text box on a different frame!

M

MTC

Hi all and thanks in advance
I have an HTML page with 3 frames. Lets call them top middle and bottom.

On the top frame there is a button to run some java script! When it is run
I want to put some text into the middle frame, but in to a text box on a
form call "testform" textbox name is "TestText"

I know I need to address the frame name but what am I missing?

Parent.frames("middle").TextText.value = "here is the data"

Thanks.

mike
 
M

Michael Winter

[snip]
I know I need to address the frame name but what am I missing?

Parent.frames("middle").TextText.value = "here is the data"

Four things:

1) You don't subscript an array with parentheses - you use brackets.
2) A reference to the form.
3) Parent should be in all lowercase.
4) The semicolon (;) - not strictly necessary, but good form.

Try:

parent.frames['middle'].forms['testform'].elements[
'TextText'].value = 'Here is the data.';

Forgive any errors in that; I never use frames so my syntax might be off.
It should help you on your way, though.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top