I would like validate the date inserted on the Pop UP Form on the front end by Angular JS. Because the wrong date would be stopped at the source. The date is in the format yyyy-MM-dd'T'HH:mm. I have the followed code:
<ng-form name="f.id">
<input ng-if="f.type === 'datetime'" type="datetime-local" ng-model="f.value" ng-required="f.required" ng-change="updateScript()" />
<input ng-if="f.type === 'host'" type="text" ng-model="f.value" ng-required="f.required" ng-change="updateScript()" />
<input ng-if="f.type === 'port' || f.type === 'number'" type="text" ng-pattern="/^\d+$/" ng-model="f.value" ng-required="f.required" ng-change="updateScript()" />
<input ng-if="f.type === 'path'" type="text" ng-model="f.value" ng-required="f.required" ng-pattern="/^((file)|(sftp)|(smb)):///" ng-change="updateScript()" />
<textarea ng-if="f.type === 'text'" ng-model="f.value" ng-required="f.required" ng-change="updateScript()"></textarea>
<select ng-if="f.type === 'select'" ng-options="item as item for item in f.availableValues" ng-model="f.value"
type="{{f.type}}" ng-required="f.required" ng-change="updateScript()"></select>
<div ng-show="f.id.$dirty && f.id.$invalid">
<span class="label label-warning">Required field </span>
</div>
</ng-form>
How can I validate the date in the Pop up and show to the user an error message? Thanks.