Forum Moderators: open

Message Too Old, No Replies

Force Submitting Parent Frame

Whats it all mean?!?

         

theriddla1019

5:09 pm on Aug 10, 2004 (gmt 0)

10+ Year Member



Alright ive read about 10,000 threads on the same topic without an understandable solution. I have an I-Frame that when the parent is submitted an onclick event submits the iframe page, updates the db via php and at the end of the update script "tries" to update the parent page. (Im having problems with sessions in php and this is the only solution ive come up with to make sure the sessions open in order) But anyways im using (and have used) parent.document.all.submit()...parent.frames[parent].document.all.submit(); - [parent] being the target name of the parent pages form. umm...cant do top because it is not the top frame...and a bunch of other variations to no avail. What is happening is that i can alert(parent.(anything)) and it pulls up the correct information but when i try to force submit the parent it gives me an error parent.document.all is null or not an object.... or parent.frames[...].document is null or not an object, and sometimes tells me that my php commenting is causing a problem... which when i take that single line of javascript out works fine. Any ideas?

theriddla1019

5:30 pm on Aug 10, 2004 (gmt 0)

10+ Year Member



Also im guessing using
parent.document.all.location.href = URL
will not post over my variables since it will not run through the form action property correct?
And my parent frames target is="_parent" not just parent and i even tried "_top" and used top.(etc etc) in the iframe with no luck..it seems like when the code "should" work properly i get the errors on line 7 character 3 no matter what is on that line and character(even if the code starts on line 8)

gaston9x19

8:29 pm on Aug 10, 2004 (gmt 0)

10+ Year Member



If you're trying to submit a specific form, try naming the form and some variation of parent.frames[parent].document.NAME.submit(); I've used a similar line of JS to send a form on the same page like this:

<FORM action="http://www.sitename.com/formMail.jsp" method="post" name="join">

...fields, fields....

<a href="javascript:document.join.submit()">Submit</a>

</form>

Not really sure how much different it would be if you need to use PHP, I'm new to that language, but I hope this helps.