I have an input field that is using a pre-existing validator called "stringValidator". I want to customize or extend this pattern without creating a new one. Is there a way to do this inline? Can I input the validation regex directly into the tag declaration?
Current Tag Declaration:
The "stringValidator" pattern, which is defined externally, has a rule that I need to override. However, I can't edit "stringValidator" or add a custom rule in the same code file.
<input type="text" id="txt-foo" placeholder="" name=""
class="form-control"
ng-model="txtName" ng-maxlength="255"
ng-pattern="stringValidator"
autocomplete="off" />
What I would like to achieve:
<input type="text" id="txt-foo" placeholder="" name=""
class="form-control"
ng-model="txtName" ng-maxlength="255"
ng-pattern="/^[^%\[\]<>"%;&()]+$/"
autocomplete="off" />
Thank you.