I'm editing some existing html where the javascript loads a another page inside an iframe. In the page is an html form. When I hit submit, I'd like for the outer page to stay and the iframe to change to the results page. However, right now the whole page changes to the results page for the form. I'm guessing there's a way to solve this javascript. Any suggestions?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Target the form to the iframe:
<iframe name="foo"></iframe>
<form target="foo"></form>
回答2:
Try using the target
attribute of the form tag. You can specify the frame.