从理论上来说,你至少可以有三种<条码>,即以你的形式提交条码>。
Button 2 是现有的不太进口的纽顿(从形式上半向下),但纽特3是现有实际提交的纽特。
Button, one should beidden (using CSS display:none
or visibility:idden
), and should exercise really the same function as You current-submit. 我认为,这仍是浏览器所发现的第一顿,不管其可见度如何。
<form method="post" method="whatever.php" enctype="form/multipart">
<fieldset id="first">
<label>...<input />
<label>...<input />
<label>...<input />
<input type="submit" value="submit" style="visibility: hidden;" <!-- or "display: none" --> />
<input class="less_important" type="submit" value="submit" />
</fieldset>
<fieldset id="second">
<label>...<input />
<label>...<input />
<label>...<input />
<input type="submit" value="submit" class="actual_submit" />
</fieldset>
</form>
www.un.org/Depts/DGACM/index_spanish.htm 摘自评论:
我认为隐藏的纽子也因违约而残疾? [md5sum]
一个有效的观点是,在张贴之前,我只把测试错误(3.5.7, 乌班图9.10)放在了上面,其中两种技术都奏效。 完整的xhtml档案是继这些评论之后作为我测试基础的(下文)。
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>3button form</title>
<link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(
function() {
$( input[type="submit"] ).click(
function(e){
alert("button " + $(this).attr("name"));
}
);
}
);
</script>
</head>
<body>
<form method="post" method="whatever.php" enctype="form/multipart">
<fieldset id="first">
<label>...<input />
<label>...<input />
<label>...<input />
<input name="one" type="submit" value="submit" style="display:none;" /><!-- or "display: none" -->
<input name="two" class="less_important" type="submit" value="submit" />
</fieldset>
<fieldset id="second">
<label>...<input />
<label>...<input />
<label>...<input />
<input name="three" type="submit" value="submit" class="actual_submit" />
</fieldset>
</form>
</body>
</html>
<代码> 显示:无代码>应防止纽芬兰成为形式的一个积极部分(列入结果组,有资格成为违约国);<代码> 可视性:<>隐蔽/代码>不应。 然而,这两个案件都受到一些浏览者错。 唯一提交纽芬兰语的通常方式是<代码>:绝对;,将其移出网页(例如左边:4,000px)。 这显然但可靠。 它对改变其表格索引也是一种好的想法,这样它不会干扰预期表格的制表。
我至少要提出两点意见。 为了:
- "The normal way..." I was unaware that there was a normal way, and presented this option as a possibility to achieve an aim, in the full knowledge that there were/are almost certainly any number of better ways, particularly given that I don t see a good reason for multiple submit buttons on the same form.
- Given the latter sentence of the above point, I d like to make it clear that I don t advocate doing this. At all. It feels like an ugly, and non-semantic, hack to have more than one submit button, with -in the OP s instance- one button apparently not being a submit button.
- The notion of `position: absolute; left: -4000px;` had occurred to me, but it seemed to effect much the same as `visibility: hidden;`, and I have an innate dislike of `position: absolute;` for whatever reason...so I went with the option that was less objectionable to me at the time of writing... =)
我赞赏你对表格索引的评论,但这是我从未想过的东西。
如果我稍感ni,那么我会 late,时间迟,我会tir......yadda-yadda; 自我回家以来,我一直在各种浏览器中测试过。 看来,“3.5+”显示同样的行为,即“视窗XP”和“Utugo”9.10,所有网络浏览器(Midori、Peophany、Safat和Shatton 2)都失败。
因此,对<代码>显示:无;提交纽州肯定是一个不值得重视的想法。 而<代码>可见性:hidden则至少可行。
我指的是,点击进入触发了形式提交活动,或引发首份提交纽扣表的点击事件,而不论第一次提交文件是“显示:无;”还是“可见:隐藏”。
请注意,我的 j格技巧有限,因此所使用的测试(我只是在时候才尝试和预防执行过程中发生的冲突,评论当时我手提的那 t,这两种说法都是介绍的――一个,明确说是评论的)可能不够充分,不具代表性。