Click to See Complete Forum and Search --> : submitting form from parent frame


doobster
09-17-2003, 01:31 PM
Hi,

I have a page that lists a frameset.

We can call it frame.html

frame.html loads two frames. a.html and b.html

In a.html I have a form with the name of report.

What I want to be able to do is submit this form from frame.html in the unload event.

I tried the following but it does not seem to work.

<script language="Javascript">

function report() {
report.submit();
}

</script>

<body onUnload="report()">

It calls the function with no problems but I am unable to submit the form that is inside the frame.

Help appreciated.

Mr J
09-17-2003, 02:08 PM
You will only be able to submit the form using the unload event in frame.html whilst a.html is loaded in its frame otherwise you will get an error

This is the code you would use

function report() {

parent.framename.formname.submit()

}