如何将 POST 表单提交到 showMessage.jsp
仅使用 <a href="...">
标签?
<form action="showMessage.jsp" method="post">
<a href="showMessage.jsp"><%=n%></a>
<input type="hidden" name="mess" value=<%=n%>/>
</form>
最佳答案
如果您改用按钮,则不需要 JavaScript:
<form action="your_url" method="post">
<button type="submit" name="your_name" value="your_value" class="btn-link">Go</button>
</form>
您可以 style a button to look like a link ,例如:
.btn-link {
border: none;
outline: none;
background: none;
cursor: pointer;
color: #0000EE;
padding: 0;
text-decoration: underline;
font-family: inherit;
font-size: inherit;
}
关于html - 如何使用 <a href ="..."> 标签提交 POST 表单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8169027/