Hi Team
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)">Lockuntillabel>
- 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>
- }

Farhan AhmedRank #73 · 25K reputationPosted Aug 26, 2020, 12:22 AM EDT
Navaneeth KrishnanRank #1,172 · 1.5K reputationPosted Aug 26, 2020, 5:56 PM EDT