phpMyEdit users can benefit also from JavaScript scripting language, when validating input values before form is submited.
For the most simple validation JavaScript can be generated to prevent null entries by the user. If an entry is required for a particular field, set the ['js']['required'] option to true.
Example 4-11. Required fields
$opts['fdd']['col_name']['js']['required'] = true; $opts['fdd']['col_name']['js']['required'] = false;
JavaScript regular expressions can be a powerful way to make interactive input validation. When used, input must match desired regular expression defined in the $opts['fdd']['col_name']['js']['regexp']. If some field does not match, JavaScript warning will be invoked to force user to change entered value.
Regular expression are written in Perl compatible style. An expression above allows form to submit only when digit/number characters are entered in the field. Empty value is also allowed, but you can use ['js']['regexp'] in combination with ['js']['required'] to prevent empty entries.
When ['js']['required'] option is used and entered value is empty, or field does not match defined ['js']['regexp'], a warning with default message is printed. Such message can be changed. This is especially useful when regular expression for checking input fields is used and we want to advice user how entered value might look like.