I have this Razor @html.CheckboxFor(model=>model.LockUntil), i want this when i check it must bring datepicker for current month, time. This is what i have done below, its not working and there are no errors when i inspect.
- <div class="form-check">
- <div class="col-xl-2">
- @Html.CheckBoxFor(model=>model.Lockuntil, new { htmlAttributes = new { @class = "form-control", id="checkbox" } })
- <label class="form-check-label" for="@Html.IdFor(model=>model.Lockuntil)">Lockuntil</label>
-
-
- </div>
-
- </div>
-
-
- @section srcipts{
- <script src="~/Scripts/jquery-ui-1.12.1.min.js"></script>
- <script type="text/javascript">
- $('#checkbox').change(function(){
- if($(this).is(':checked')){
- $( "#from" ).datepicker('setDate', new Date(2020, 08, 26)).datepicker( "option", "disabled", true );
- }else{
- $( "#to" ).datepicker( "option", "disabled", false);
-
- }
- });
- });
- </script>
-
- }