I have two situation where either data exists or have to be manually entered. I want to be able to disable or enable button based on text value lenght
View
@if (Model.JSAActivity != null)
{
@Html.DisplayFor(model => model.JSAActivity)
}
else
{
}
jquery
$(function () {
$("#DivAddData").on("change", function () {
var minLenght = 3;
var ia1 = $("#InpAct1").val().length;
var ia2 = $("#InpAct2").val().length;
var hd = $("#hazDetail").val().length;
var ic = $("#InpCont").val().length;
var ir = $("#InpResp").val().length;
if (ia1 > minLenght || ia2 > minLenght && hd > minLenght && ic > minLenght && ir > minLenght) {
$("#btnSubmitAD").attr("disabled", false);
}
else {
$("#btnSubmitAD").attr("disabled", true);
}
});
});
Marius VasilePosted Aug 27, 2021, 11:06 AM