| verzia 1.48, 2004/04/12 22:20:24 |
verzia 1.49, 2004/04/14 20:28:52 |
|
|
| <!-- $Platon: phpMyEdit/doc/sgml/configuration.fields.sgml,v 1.47 2004/04/12 22:14:41 nepto Exp $ --> |
<!-- $Platon: phpMyEdit/doc/sgml/configuration.fields.sgml,v 1.48 2004/04/12 22:20:24 nepto Exp $ --> |
| |
|
| <!-- Categories: |
<!-- Categories: |
| |
|
| Riadok 314 $opts['fdd']['col_name']['escape'] = fal |
|
| Riadok 314 $opts['fdd']['col_name']['escape'] = fal |
|
| </para> |
</para> |
| </sect1> |
</sect1> |
| |
|
| <sect1 id="configuration.input-validation"> |
<sect1 id="configuration.javascript-validation"> |
| <title id="configuration.input-validation.title">Input validation</title> |
<title id="configuration.javascript-validation.title">JavaScript validation</title> |
| <para> |
<para> |
| |
|
| &name; users can benefit also from JavaScript scripting language, when |
&name; users can benefit from the JavaScript scripting language, when |
| validating input values before form is submited. |
validating input values before the form is submited. |
| |
|
| </para> |
</para> |
| <bridgehead id="configuration.fields.js.required">Required fields</bridgehead> |
<bridgehead id="configuration.fields.js.required">Required fields</bridgehead> |
| <para> |
<para> |
| |
|
| For the most simple validation JavaScript can be generated to prevent null |
Simple validation JavaScript can be generated to prevent null |
| entries by the user. If an entry is required for a particular field, set the |
entries by the user. If an entry is required for a particular field, set the |
| <varname>['js']['required']</varname> option to <constant>true</constant>. |
<varname>['js']['required']</varname> option to <constant>true</constant>. |
| |
|
| Riadok 341 $opts['fdd']['col_name']['js']['required |
|
| Riadok 341 $opts['fdd']['col_name']['js']['required |
|
| <para> |
<para> |
| |
|
| JavaScript regular expressions can be a powerful way to make interactive input |
JavaScript regular expressions can be a powerful way to make interactive input |
| validation. When used, input must match desired regular expression defined |
validation. When used, input must match the desired regular expression defined |
| in the <varname>$opts['fdd']['col_name']['js']['regexp']</varname>. |
in the <varname>$opts['fdd']['col_name']['js']['regexp']</varname>. |
| If some field does not match, JavaScript warning will be invoked to force user |
If a field does not match, a JavaScript alert will be invoked to force the user |
| to change entered value. |
to change entered value. |
| |
|
| <example><title>Regular expression example</title> |
<example><title>Regular expression example</title> |
| Riadok 355 $opts['fdd']['col_name']['js']['regexp'] |
|
| Riadok 355 $opts['fdd']['col_name']['js']['regexp'] |
|
| </para> |
</para> |
| <para> |
<para> |
| |
|
| Regular expression are written in Perl compatible style. An expression above |
Regular expressions are written in Perl compatible style. The expression above |
| allows form to submit only when digit/number characters are entered in the |
allows the form to submit only when numeric characters |
| field. Empty value is also allowed, but you can use |
<constant>0-9</constant> are entered in the field. An empty value is also |
| <varname>['js']['regexp']</varname> in combination with |
allowed, but you can use <varname>['js']['regexp']</varname> in combination |
| <varname>['js']['required']</varname> to prevent empty entries. |
with <varname>['js']['required']</varname> to prevent empty entries. |
| |
|
| </para> |
</para> |
| <bridgehead id="configuration.fields.js.hint">Hints</bridgehead> |
<bridgehead id="configuration.fields.js.hint">Hints</bridgehead> |
| <para> |
<para> |
| |
|
| When <varname>['js']['required']</varname> option is used and entered value is |
When the <varname>['js']['required']</varname> option is used and the value |
| empty, or field does not match defined <varname>['js']['regexp']</varname>, |
entered is empty, or the characters entered do not match the defined |
| a warning with default message is printed. Such message can be changed. |
<varname>['js']['regexp']</varname>, a warning with the default message |
| This is especially useful when regular expression for checking input fields is |
is displayed. This message can be changed using |
| used and we want to advice user how entered value might look like. |
<varname>['js']['hint']</varname>. This is especially useful for advising the |
| |
user about field-specific data input restrictions. |
| |
|
| <example><title>JavaScript hint</title> |
<example><title>JavaScript hint</title> |
| <programlisting><![CDATA[ |
<programlisting><![CDATA[ |