I have two textboxes if i insert a value in Landscaping, then Compound Walling gets disabled
Enter Value for Landscaping
Html.TextBoxFor(model => model.landscapingsqm, htmlAttributes: new { id = "landscape", class = "form-control", onchange = "onchangeland()" })
Html.ValidationMessageFor(model => model.landscapingsqm, "", new { class = "text-danger" })
Html.TextBoxFor(model => model.landscapingsqm, htmlAttributes: new { id = "landscape", class = "form-control", onchange = "onchangeland()" })
Html.ValidationMessageFor(model => model.landscapingsqm, "", new { class = "text-danger" })
Enter Value for Compound Walling
Html.TextBoxFor(model => model.compoundwalling, htmlAttributes: new { id = "compoundwall", class = "form-control", onchange = "onchangecompoundwalling()" })
Html.ValidationMessageFor(model => model.compoundwalling, "", new { class = "text-danger" })
Html.TextBoxFor(model => model.compoundwalling, htmlAttributes: new { id = "compoundwall", class = "form-control", onchange = "onchangecompoundwalling()" })
Html.ValidationMessageFor(model => model.compoundwalling, "", new { class = "text-danger" })
Vishal JoshiPosted May 29, 2024, 9:59 AM
Hello,
You can check on the page load/Edit the record. try the below sample code to fix the change.
Thanks
Vishal Joshi
Tuhin PaulPosted May 31, 2024, 6:28 PM
A mock fetchData function is added to simulate an AJAX call. The ajaxCalltoGetData function is called with the fetched data once the document is ready.
Vikas SinghPosted May 28, 2024, 11:58 AM
@Garima, you can try below one-
Enter Value for Landscaping
@Html.TextBoxFor(model => model.landscapingsqm, new { id = "landscape", class = "form-control", onchange = "onchangeland()" })
@Html.ValidationMessageFor(model => model.landscapingsqm, "", new { class = "text-danger" })
Enter Value for Compound Walling
@Html.TextBoxFor(model => model.compoundwalling, new { id = "compoundwall", class = "form-control", onchange = "onchangecompoundwalling()" })
@Html.ValidationMessageFor(model => model.compoundwalling, "", new { class = "text-danger" })
Amit MohantyPosted May 28, 2024, 11:40 AM
Try this: