$.fn.disable = function(){
//扩展jQuery,表单元素统一disable
return this.each(function(){
if(typeof this.disabled != "undefined") this.disabled = true;
});
}
$.fn.enable = function(){
//扩展jQuery,表单元素统一enable
return this.each(function(){
if(typeof this.disabled != "undefined") this.disabled = false;
});
}
function SwapInput(oName,oButton){
if(oButton.value == "Disable"){
//如果按钮的值为Disable,则调用disable()方法
$("input[name="+oName+"]").disable();
oButton.value = "Enable";
}else{
//如果按钮的值为Eable,则调用enable()方法
$("input[name="+oName+"]").enable();
oButton.value = "Disable"; //然后设置按钮的值为Disable
}
}