0

I just noticed this. I am using jquery 1.10.0.min and jquery-ui.min 1.9.2
During normal entry of date field, my datepicker shows up, but if i have a validation error on any other fields, and once the validation error corrected, i am not able to get the datepicker pop up, and i have to manually type in the date. Very strange.

My jquery code for date-picker:

 $(function() {
       $(".datepicker").datepicker({
          changeMonth: true,
          changeYear: true,
          yearRange: '2000:2050'
        });
     });

My view :

<td>
    @Html.TextBoxFor(model => model.POP_Start, "{0:M/dd/yyyy}", new { @class = "form-control prdetailscustomtextbox datepicker", @autocomplete = "off" })

    @Html.ValidationMessageFor(model => model.POP_Start, "", new { @class = "text-danger" })
</td>

Any pointer in fixing this issue is greatly appreciated.

TIA

Ron
  • 1,901
  • 4
  • 19
  • 38
  • Please add a tag for the framework you're using `@Html.TextBoxFor` is not HTML. – Barmar Apr 30 '21 at 18:56
  • So maybe your element is re-created or has removed events from it? Have you tried re-binding datepicker? – Justinas Apr 30 '21 at 18:56
  • https://stackoverflow.com/questions/10433154/putting-datepicker-on-dynamically-created-elements-jquery-jqueryui answered my question and resolved my issue – Ron May 01 '21 at 19:54

0 Answers0