$(document).ready(function() {
$("#FieldsetID").each(function() {
$('.Isubmit').attr('disabled', 'disabled');
});
});
Run Code Online (Sandbox Code Playgroud)
按钮显示为禁用但当我点击它的doign动作时?
是我做错了什么?
谢谢
由于某种原因,当您单击禁用的提交按钮时,IE 不会阻止事件冒泡。
我假设您的祖先上有一些其他事件处理程序因此被触发。
在该祖先的事件处理程序中,您似乎需要测试该submit按钮是否被单击以及是否被禁用。如果是这样,您将return false;阻止代码运行、提交或发生其他情况。
// Not sure if this is the right event, but you get the idea
$( someSelector ).click(function( event ) {
var $target = $(event.target);
// check to see if the submit was clicked
// and if it is disabled, and if so,
// return false
if( $target.is(':submit:disabled') ) {
return false;
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11125 次 |
| 最近记录: |