I need to validate input type only in some cases with regex pattern. But when that fields is hidden , whole form isn't valid so I can't proceed. Is there a way that I can make pattern conditional
<input type="text" class="form-control" name="FileName" id="FileName" ng-model="FileName" ng-required="fileModalMode=='Rename' || fileModalMode=='Create'" pattern="^(\w+\.?)*\w+$">
So something like
<input type="text" class="form-control" name="FileName" id="FileName" ng-model="FileName" ng-required="fileModalMode=='Rename' || fileModalMode=='Create'" ng-pattern="fileModalMode=='Rename' || fileModalMode=='Create' ? '^(\w+\.?)*\w+$'">
Aucun commentaire:
Enregistrer un commentaire