要在按钮上显示页面URL名称:
<form method="get" action="<this page's address>">
<input type="submit" name="page" value="page1" />
<input type="submit" name="page" value="page2" />
</form>
或者,在此处显示其他文本:
<form method="get" action="<this page's address>">
<input type="submit" name="page" value="Page 1 button text" onclick="this.value='page1'" />
<input type="submit" name="page" value="Page 2 button text" onclick="this.value='page2'" />
</form>
或者最后,使用隐藏字段和 jQuery:
<form method="get" action="<this page's address>">
<input type="submit" value="Page 1 button text" onclick="$('#hidden').val('page1')" />
<input type="submit" value="Page 2 button text" onclick="$('#hidden').val('page2')" />
<input type="hidden" name="page" id="hidden" />
</form>