I have a form and an iframe. I want to set the source of the iframe on form submit to a 3rd party payment gateway url. Also, onSubmit a javascript function is called. I want to display the response of the form submit within a iframe rather than in the parent window. Kindly guide me. Thanks.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
<form target="frame" onsubmit="document.getElementById('frame').style.display = 'block';">
</form>
<iframe id="frame" name="frame" style="display: none;"></iframe>
I think that's all you need ;)