manyi frames, data in one, problems accessing it from another iframe

G

Guest

i have an order page mostly written in javascript. (it's been fun)

not this part though.
the IF statement and using the information from the form in one iframe in
another iframe for processing, so it shows the orders made. (the posting of
the orders is not an issue here, it is sent to a file on the sever.)

i have added alert("alert1") with the number changed every time i use it.
to see what is happening.

first i think i need to get the form issue sorted.

is there a site that is just about forms, and how to access the data within
forms while in another frame via a function call to a .js file.

the document......
and parent......
commands are really confusing, in the way it is used. i need to find how to
use these correctly.

i have a file shown below that is called showorders.js, it is called from
the frame that need the information.

function showorders() {
alert("start of show orders script");
form = document.forms.favororders;
document.write(form.Avocado.value);
alert("end of show orders script");
}


but the only line that work is the first alert, the rest is not working, or
executed.

i have checked the spellings and the case of the letters, all are correct.

omiting the document.write.... line the script run from start to finish
showing both alerts.

what is the correct syntax for this line?


thanks

Jason
 
J

Jens Peter Karlsen[FP MVP]

document.write writes to the page. Assuming the script is the header, it
wouldn't be visible on the page that it writes "form.Avocado.value"
It seems that what you really want is to change the value of a formfield
with the name Avocado.
You would do it like this:
document.forms[0].Avocado.value=whatever;

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
G

Guest

Re: manyi frames, data in one, problems accessing it from another iframesorry not wanting to change the value of Avocado, each variable in the form was set via the pull down menus. I am wanting to use the information in the form and show the results in another frame.


document.write writes to the page. Assuming the script is the header, it wouldn't be visible on the page that it writes "form.Avocado.value"

It seems that what you really want is to change the value of a formfield with the name Avocado.
You would do it like this:
document.forms[0].Avocado.value=whatever;

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 

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

Top