I'm trying to get this working, based on a YouTube video that credits this forum post. However, I've tried it exactly as shown on the video and with numerous alterations in an attempt to make it function properly. I can make either form initiate an email, but with only the elements from the posting page, the parent or the iframe. No matter what I try, it won't combine the data from both when I post from the parent. What am I missing?
Here's my parent code:
<body>
<form action="mailto:[email protected]?subject=Test" onsubmit="this.submit();return false;" id="form1" method="post" enctype="text/plain">
Parent Entry:<input type="text" size="25" name="Parent Entry">
<br>
<iframe src ="testiframe.htm" width="auto" height="44px" frameborder="0">
</iframe>
<br>
<input type="image" name src="email.gif" border="0" width="200" onsubmit="submitBothForms()">
<script>
function submitBothForms() {
var iframedoc = document.getElementById('myIframe').contentWindow.document;
var inputs = iframedoc.getElementsByTagName('input');
$('#form1').append($(inputs));
document.getElementById('form1').submit();
}
</script>
</form>
</body>
And my iframe code:
<body>
<form action="mailto:[email protected]?subject=Test" onsubmit="this.submit();return false;" id="form2" method="post" enctype="text/plain">
iFrame Entry: <input type="text" size="20" name="iFrame Entry" value="" id="myIframe" /><br><br>
<input type="image" name src="email.gif" border="0" width="200" onsubmit="this.submit()">
<script>
var iframedoc = getElementById('myIframe').contentWindow.document;
var inputs = iframedoc.getElementsByTagName('input');
iframedoc.getElementsByTagName('form')[0].submit();
</script>
</form>
</body>