Extension:Page Forms/Input types/Regexp

With the input type you can fine tune what values are allowed and what is blocked in your input fields. You can even string several filters together to have a cascade of checks to give an error message specific to what violation occurred.The special parameters for this input type are a Javascript regular expression, which the user input has to match. It must include slashes, at the beginning and end. See Regular Expressions for an introduction to writing a regular expression pattern in, Regex Pal for an interactive testing tool. Note that for the you cannot use the chartest because it gets lost in the field definition. See the code below base the actual input type to display. By default,text, but it can be any other input type as well. if set, the input must NOT match the regular expression in order to a custom error message to display, when the user input does not pass the validation. Defaults to Wrong formst or its equivalent in the current 7the character that can be used in the regular expression instead of Defaults to background lets you set more than one regexp for this input; see below. If you want to specify more than one regexp filter, you need to specify a prefix for each filter in the parameter base prefix of its predecessor. Sounds complicated. Have a look at the example below. You may, but do not need to specify a prefix for the final input type each filter stage consumes only the parameters from the parameter set that it understands the specific parameters listed below. A simple text input field accepting only letters, numbers and spaces.This may be useful for fields from which an article's name is generated in the Page Forms The one step process. A text input field accepting only numbers and having no more than 5 digits. Certain numbers are forbidden. Each condition gets its own message. No more than 5 filter 3. A somewhat more complicated input field accepting valid dates in the format yyyy/mm/dd with the basetype datepicker, so the user can either use the date picker or insert the date dir. No point anymore. the datepicker takes care of proper formatting. Worst that could happen is an empty field.The Extension Simple Anti Spam extension adds a hidden form field to the edit page as an antispam bot check. If the field is not blank when the page is saved, the save will be aborted and a generic you triggered the spam filter page will be shown. You can mimic that by including the code of this example in your form. Be aware that no message will be shown when the filter is triggered, but why bother showing messages to a spam bot?