Make link using submit button

偶尔善良 提交于 2019-12-11 10:26:17

问题


Can I link one page to another page using submit button?


回答1:


It sends all the wrong signals to the user, but:

<form action="some-uri"><div><input type="submit"></div></form>



回答2:


The problem with using a submit form is that the next page will think that it has to deal with a binary request, which you can't do if using an upload form.

So you are better using a image button (can make it look like a submit button) or using JavaScript...

Open in a new window:

onClick="window.open('page.html');"

Open in the same window:

onClick="document.location.href = ('page.html');"


来源:https://stackoverflow.com/questions/5013576/make-link-using-submit-button

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