How do I submit an html form inside an iframe with

2019-02-06 00:42发布

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?

2条回答
Bombasti
2楼-- · 2019-02-06 01:22

Target the form to the iframe:

<iframe name="foo"></iframe>

<form target="foo"></form>
查看更多
男人必须洒脱
3楼-- · 2019-02-06 01:22

Try using the target attribute of the form tag. You can specify the frame.

查看更多
登录 后发表回答