How to set the response of a form post action to a iframe source?

旧城冷巷雨未停 提交于 2020-01-15 08:53:09

问题


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 ;)



来源:https://stackoverflow.com/questions/7244505/how-to-set-the-response-of-a-form-post-action-to-a-iframe-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!