Skip to content

Instantly share code, notes, and snippets.

@alber70g
Created August 5, 2014 13:52
Show Gist options
  • Save alber70g/dd353fc763fbfda870d5 to your computer and use it in GitHub Desktop.
Save alber70g/dd353fc763fbfda870d5 to your computer and use it in GitHub Desktop.
ui-validate example
<input id="itemcodeSupplier" type="text" name="artikelcodeLeverancier" placeholder="Binnen gekozen productklasse (bijv. code 1; code2)"
ng-disabled="!Filters.SelectedProductClassId" ng-model="FiltersText.SelectedItemCodeSuppliers"
ng-list=";" ui-validate="{maxLength : 'maxLengthValidator($value, 35)' }" />
<span style="color: red" ng-show="selectie.artikelcodeLeverancier.$error.maxLength">
<script>
var maxLengthValidator = function ($value, 35){
return $value.length <= 35;
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment