Royce Royce - 1 year ago 146
jQuery Question

Angular JS and JQuery datepicker

My birthdate field was created by JQuery using datepicker function then the required field validation is handled by AngularJS using ng-show whenver I submit the form there is a error handling but when I choose date in the field the error message is not remove.

<input type="text name="birthdate" id="datepicker" ng-model="birthdate" readonly required >
<span id="errordate" ng-show="submitted && form.birthdate.$error.required">*required</span><br>


Here is the form look at the birthdate field
Please Help me thank you.

Answer Source

When jQuery DatePicker apply change to <input>, AngularJS does not know this change, you must call $scope.$apply() to make AngularJS check and apply new changes. But I think you should use $timeout to apply this change and avoid AngularJS inprog error, more information here.

Here is my ONLINE DEMO. Hope this help!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download