Hi Rashal,
Thanks for Contacting Syncfusion Support.
We have investigated your query. You can enable the EJ2 DatePicker on clicking the Button control, by setting enabled property as true, dynamically by using DatePicker object instance. Please, find the code sample for achieving your requirement below.
[datepicker.cshtml]
|
@Html.EJS().DatePicker("NominationDate").Value(DateTime.Today).Format("dd MMM yyyy").Enabled(false).Render()
@Html.EJS().Button("UnLockDay").Content("Success").Render()
<script>
document.getElementById("UnLockDay").addEventListener('click', function () {
var DatePickerInstance = document.getElementById("NominationDate").ej2_instances[0];
DatePickerInstance.enabled = true;
});
</script> |
Also, check out the following links to know more about EJ2 DatePicker and Button components in ASP.NET MVC.
DatePicker:
Button:
Please, let us know if you need further assistance.
Regards,
Deepa L.