Posting HTML Form and iframe's form data together
HTML Form and iframe's form data can be posted simultaneously using the same submit. Whats needed to be done is that first we post/submit the iframe's form data and then post/submit the HTML form's data.
main HTML code
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="text/javascript">
function selectSubmit(argThis)
{
// submit the iframe and then the form
iframepage.myiframeform.submit();
document.mainFormPage.submit();
}
</script>
</head>
<body>
<form name="mainFormPage" action="#" method="post">
<iframe id="iframepage" name="iframepage" src="iframehtml.html" width="100%" height="270px" frameborder="0" scrolling="no">
</iframe>
<label>lastname: </label>
<input type="text' id="id2" value="some lastname"/>
<label>city: </label>
<input type="text' id="id3" value="some city"/>
<input type="submit" id="savebtn" onclick="javascript:selectSubmit(this)"
value='save button' />
</form>
</body>
</html>
IFRAME HTML code
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
</head>
<body>
<form id="myiframeform" name="myiframeform" action="#" method="post">
<label>name : </label>
<input type="text' id="id1" value="some name"/>
</form>
</body>
</html>
HTML Form and iframe's form data can be posted simultaneously using the same submit. Whats needed to be done is that first we post/submit the iframe's form data and then post/submit the HTML form's data.
main HTML code
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="text/javascript">
function selectSubmit(argThis)
{
// submit the iframe and then the form
iframepage.myiframeform.submit();
document.mainFormPage.submit();
}
</script>
</head>
<body>
<form name="mainFormPage" action="#" method="post">
<iframe id="iframepage" name="iframepage" src="iframehtml.html" width="100%" height="270px" frameborder="0" scrolling="no">
</iframe>
<label>lastname: </label>
<input type="text' id="id2" value="some lastname"/>
<label>city: </label>
<input type="text' id="id3" value="some city"/>
<input type="submit" id="savebtn" onclick="javascript:selectSubmit(this)"
value='save button' />
</form>
</body>
</html>
IFRAME HTML code
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
</head>
<body>
<form id="myiframeform" name="myiframeform" action="#" method="post">
<label>name : </label>
<input type="text' id="id1" value="some name"/>
</form>
</body>
</html>
No comments:
Post a Comment