Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, October 14, 2026

Diff for phpMyEdit/doc/sgml/configuration.fields.sgml between version 1.46 and 1.47

version 1.46, 2004/04/04 20:42:35 version 1.47, 2004/04/12 22:14:41
Line 1 
Line 1 
 <!-- $Platon: phpMyEdit/doc/sgml/configuration.fields.sgml,v 1.45 2004/04/01 10:40:00 nepto Exp $ -->  <!-- $Platon: phpMyEdit/doc/sgml/configuration.fields.sgml,v 1.46 2004/04/04 20:42:35 nepto Exp $ -->
   
 <!-- Categories:  <!-- Categories:
   
Line 264  All variables in following section shoul
Line 264  All variables in following section shoul
   
 </para>  </para>
   
 <bridgehead id="configuration.fields.required">Required fields</bridgehead>  
 <para>  
   
 By default, JavaScript will be generated to prevent null entries by the user. If  
 an entry is not required for a particular field, change the setting to  
 <constant>false</constant>.  
   
 <example><title>Required fields</title>  
 <programlisting><![CDATA[  
 $opts['fdd']['col_name']['required'] = true;  
 $opts['fdd']['col_name']['required'] = false;  
 ]]></programlisting>  
 </example>  
   
 </para>  
   
 <bridgehead id="configuration.fields.sort">Sorting</bridgehead>  <bridgehead id="configuration.fields.sort">Sorting</bridgehead>
 <para>  <para>
   
Line 328  $opts['fdd']['col_name']['escape'] = fal
Line 312  $opts['fdd']['col_name']['escape'] = fal
 ]]></programlisting>  ]]></programlisting>
 </example>  </example>
   
   </para>
   </sect1>
   
   <sect1 id="configuration.input-validation">
   <title id="configuration.input-validation.title">Input validation</title>
   <para>
   
   &name; users can benefit also from JavaScript scripting language, when
   validating input values before form is submited.
   
   </para>
   <bridgehead id="configuration.fields.js.required">Required fields</bridgehead>
   <para>
   
   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
   <varname>['js']['required']</varname> option to <constant>true</constant>.
   
   <example><title>Required fields</title>
   <programlisting><![CDATA[
   $opts['fdd']['col_name']['js']['required'] = true;
   $opts['fdd']['col_name']['js']['required'] = false;
   ]]></programlisting>
   </example>
   
   </para>
   <bridgehead id="configuration.fields.js.regexp">Regular expressions</bridgehead>
   <para>
   
   JavaScript regular expressions can be a powerful way to make interactive input
   validation. When used, input must match desired regular expression defined
   in&nbsp;the&nbsp;<varname>$opts['fdd']['col_name']['js']['regexp']</varname>.
   If some field does not match, JavaScript warning will be invoked to force user
   to change entered value.
   
   <example><title>Regular expression example</title>
   <programlisting><![CDATA[
   $opts['fdd']['col_name']['js']['regexp'] = '/^[0-9]*$/';
   ]]></programlisting>
   </example>
   
   </para>
   <para>
   
   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
   <varname>['js']['regexp']</varname> in combination with
   <varname>['js']['required']</varname> to prevent empty entries.
   
   </para>
   <bridgehead id="configuration.fields.js.hint">Hints</bridgehead>
   <para>
   
   When <varname>['js']['required']</varname> option is used and entered value is
   empty, or field does not match defined <varname>['js']['regexp']</varname>,
   a&nbsp;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.
   
   <example><title>JavaScript hint</title>
   <programlisting><![CDATA[
   $opts['fdd']['col_name']['js']['hint']
     = 'Please enter only numbers in the "col_name" field.';
   ]]></programlisting>
   </example>
   
 </para>  </para>
 </sect1>  </sect1>
   

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top