Just Holden Commodores - Sport Betting Systems - Debt Consolidation - Debt Consolidation - Internet Advertising

PDA

View Full Version : submit form in frame2 after submitting form in frame1


Oreamnos
Mar 26th 2006, 6:01 am
anyone know how i can submit a form in frame2 after submitting a form in frame1?

i've been using the following code (and modifications of it) but it's not working at all:<script type="text/javascript">
<!--
function submitform()
{
parent.form2.submit();
return true;
}
//-->
</script>
<form method="post" name="form1" onSubmit="return submitform();">
field2: <input name="field2" value="<?php echo $_POST['field2']; ?>" type="text"><br />
<input type="submit" name="submit" value="submit">
</form>
my other form is named form2 and holds the preceding code in an <iframe>.

any help would be totally appreciated on this one as i've been struggling with this for a few days... :(

thanks
eric

Slapyo
Mar 26th 2006, 11:00 am
Have you tried this.

parent.otherframename.form2.submit();

Oreamnos
Mar 26th 2006, 2:43 pm
i'm not sure what to call the "frame" that holds the iframe... my iframe is just embedded in a standard page, what would the name of that page be?

Slapyo
Mar 27th 2006, 7:24 am
So you have a page which loads 2 frames. Then in one of those frames is an iframe with some javascript and a form you are trying to submit?
parent.otherframename.iframename.form2.submit();