3 回答

TA贡献1719条经验 获得超6个赞
我希望这有帮助。我只是在float按右边的按钮。
这样,Prev按钮位于按钮的左侧Next,但Next在HTML结构中排在第一位:
.f {
float: right;
}
.clr {
clear: both;
}
<form action="action" method="get">
<input type="text" name="abc">
<div id="buttons">
<input type="submit" class="f" name="next" value="Next">
<input type="submit" class="f" name="prev" value="Prev">
<div class="clr"></div><!-- This div prevents later elements from floating with the buttons. Keeps them 'inside' div#buttons -->
</div>
</form>
优于其他建议的好处:没有JavaScript代码,无法访问,并且两个按钮都保留type="submit"
。

TA贡献1844条经验 获得超8个赞
将以前的按钮类型更改为这样的按钮:
<input type="button" name="prev" value="Previous Page" />
现在,“ 下一步”按钮将成为默认按钮,此外,您还可以default向其中添加属性,以便浏览器将其突出显示,如下所示:
<input type="submit" name="next" value="Next Page" default />

TA贡献1848条经验 获得超10个赞
为您的提交按钮命名,如下所示:
<input type="submit" name="submitButton" value="Previous Page" />
<input type="submit" name="submitButton" value="Next Page" />
当用户按下Enter并将请求发送到服务器时,您可以submitButton在服务器端代码中检查其中包含表单name/value对集合的值。例如,在ASP Classic中:
If Request.Form("submitButton") = "Previous Page" Then
' Code for the previous page
ElseIf Request.Form("submitButton") = "Next Page" Then
' Code for the next page
End If
- 3 回答
- 0 关注
- 1400 浏览
相关问题推荐
添加回答
举报