[fix] [minor] use prop instead of attr to disable a field
diff --git a/accounts/doctype/sales_invoice/pos.js b/accounts/doctype/sales_invoice/pos.js
index 1bd6de1..b5a781c 100644
--- a/accounts/doctype/sales_invoice/pos.js
+++ b/accounts/doctype/sales_invoice/pos.js
@@ -395,7 +395,7 @@
});
dialog.show();
- dialog.get_input("total_amount").attr("disabled", "disabled");
+ dialog.get_input("total_amount").prop("disabled", true);
dialog.fields_dict.pay.input.onclick = function() {
cur_frm.set_value("mode_of_payment", dialog.get_values().mode_of_payment);
diff --git a/public/js/website_utils.js b/public/js/website_utils.js
index 95cae1b..d22d765 100644
--- a/public/js/website_utils.js
+++ b/public/js/website_utils.js
@@ -18,7 +18,7 @@
wn.call = function(opts) {
if(opts.btn) {
- $(opts.btn).attr("disabled", "disabled");
+ $(opts.btn).prop("disabled", true);
}
if(opts.msg) {
@@ -51,7 +51,7 @@
dataType: "json",
success: function(data) {
if(opts.btn) {
- $(opts.btn).attr("disabled", false);
+ $(opts.btn).prop("disabled", false);
}
if(data.exc) {
if(opts.btn) {
diff --git a/stock/page/stock_ledger/stock_ledger.js b/stock/page/stock_ledger/stock_ledger.js
index dacd78c..c83fc0e 100644
--- a/stock/page/stock_ledger/stock_ledger.js
+++ b/stock/page/stock_ledger/stock_ledger.js
@@ -100,11 +100,11 @@
toggle_enable_brand: function() {
if(!this.filter_inputs.item_code.val()) {
- this.filter_inputs.brand.removeAttr("disabled");
+ this.filter_inputs.brand.prop("disabled", false);
} else {
this.filter_inputs.brand
.val(this.filter_inputs.brand.get(0).opts.default_value)
- .attr("disabled", "disabled");
+ .prop("disabled", true);
}
},
diff --git a/stock/page/stock_level/stock_level.js b/stock/page/stock_level/stock_level.js
index 0699b7d..df7c8c5 100644
--- a/stock/page/stock_level/stock_level.js
+++ b/stock/page/stock_level/stock_level.js
@@ -115,11 +115,11 @@
toggle_enable_brand: function() {
if(!this.filter_inputs.item_code.val()) {
- this.filter_inputs.brand.removeAttr("disabled");
+ this.filter_inputs.brand.prop("disabled", false);
} else {
this.filter_inputs.brand
.val(this.filter_inputs.brand.get(0).opts.default_value)
- .attr("disabled", "disabled");
+ .prop("disabled", true);
}
},
diff --git a/utilities/demo/demo-login.js b/utilities/demo/demo-login.js
index 229d169..509057b 100644
--- a/utilities/demo/demo-login.js
+++ b/utilities/demo/demo-login.js
@@ -3,7 +3,7 @@
$("#login_btn").click(function() {
var me = this;
- $(this).html("Logging In...").attr("disabled", "disabled");
+ $(this).html("Logging In...").prop("disabled", true);
wn.call({
"method": "login",
args: {
@@ -12,7 +12,7 @@
lead_email: $("#lead-email").val(),
},
callback: function(r) {
- $(me).attr("disabled", false);
+ $(me).prop("disabled", false);
if(r.exc) {
alert("Error, please contact support@erpnext.com");
} else {
@@ -23,5 +23,5 @@
})
return false;
})
- .attr("disabled", false);
+ .prop("disabled", false);
})
\ No newline at end of file