Custom filters

Filters are stored inside tmt.validator.filters, a JavaScript object, acting as a container for both built-in and custom filters. In order to add our own, we can call the tmt.validator.createFilter function. The tmt.validator.createFilter() function requires 2 arguments

  1. Regular expression pattern for the content we want to remove
  2. The string that will replace the content (often just an empty string)

<script type="text/javascript">
tmt.validator.filters.a_to_f = tmt.validator.createFilter("[^a-fA-F]", "");
</script>

Custom Filter
Only letters, from a to f (both lower and uppercase)