User:F.trott/Semantic Forms Inputs

Date Picker
Input type: datepicker

The Date Picker lets a user pop up a graphical calendar and enables the user to choose a date from it. The calendar is generated entirely via script and can be navigated without any page refreshes.

Preconditions: The [http://developer.yahoo.com/yui/ Yahoo! User Interface] (YUI) Javascript library must be available, i.e. locally installed or via existing internet connection. As the library is used by the Semantic Forms extension as well, this should not be a problem.

Example: A field that uses a simple date picker with all parameters set to their default values

Example: A field that uses a date picker with specific parameters:

Regular Expression Filter
Input type: regexp

What it does: With the Regular Expression Filter 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, e.g. to give an error message specific to what violation occured.

How it works: Specify regexp as your input type and in the parameter regexp give a Javascript regular expression, that the user input has to match. If you want a base type different from text specify it with the parameter base type. Finally you may want to specify an error message with the message parameter. Oh yeah, there is of course the problem, that you can not use the | character because it gets lost in the field definition. Use ! instead. Or specifiy any other replacement character in the parameter or char and use that. See for an introduction to writing a regular expression pattern in Javascript.

If you want to specify a chain of regexp filters there is the problem, that every parameter can be used only once in every field definition, e.g. just giving regexp twice will not work. To work around that and still be able to address the filters further down the chain, 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, i.e. the specific parameters listed below.

Example: A simple text input field accepting only numbers

Example: A text input field accepting only numbers and having no more than 5 digits. Each condition gets its own error message. Oh yeah, there are evil numers, by the way.

Example: A somewhat more complicated input field accepting valid dates in the (german) format dd.mm.yyyy with the basetype datepicker, so the user can either use the date picker or insert the date directly.