Changeset 452

Show
Ignore:
Timestamp:
06/02/07 00:31:58 (2 years ago)
Author:
laurentj
Message:

worked on jforms, ticket #183 : including generated javascript script into the generated html form

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/jforms/build/manifests/jelix-lib.mn

    r442 r452  
    341341cd lib/jelix-www/js 
    342342  tooltip.js 
     343  jforms.js 
    343344cd lib/jelix-www/xul 
    344345  jxulform.css 
  • branches/experimental/jforms/build/manifests/jelix-lib.mn

    r442 r452  
    341341cd lib/jelix-www/js 
    342342  tooltip.js 
     343  jforms.js 
    343344cd lib/jelix-www/xul 
    344345  jxulform.css 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_EN/formserr.ISO-8859-1.properties

    r441 r452  
    66invalid.xml.file=(805) invalid xml syntax in jforms file (file %s) 
    77 
     8js.err.invalid= "%s" field is invalid 
     9js.err.required= "%s" field is required 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_EN/formserr.ISO-8859-1.properties

    r441 r452  
    66invalid.xml.file=(805) invalid xml syntax in jforms file (file %s) 
    77 
     8js.err.invalid= "%s" field is invalid 
     9js.err.required= "%s" field is required 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_EN/formserr.UTF-8.properties

    r441 r452  
    66invalid.xml.file=(805) invalid xml syntax in jforms file (file %s) 
    77 
     8js.err.invalid= "%s" field is invalid 
     9js.err.required= "%s" field is required 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_EN/formserr.UTF-8.properties

    r441 r452  
    66invalid.xml.file=(805) invalid xml syntax in jforms file (file %s) 
    77 
     8js.err.invalid= "%s" field is invalid 
     9js.err.required= "%s" field is required 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_US/formserr.ISO-8859-1.properties

    r441 r452  
    55datatype.unknow=(804) unknow datatype %1$s  on %2$s (file %3$s) 
    66invalid.xml.file=(805) invalid xml syntax in jforms file (file %s) 
     7 
     8js.err.invalid= "%s" field is invalid 
     9js.err.required= "%s" field is required 
     10 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_US/formserr.ISO-8859-1.properties

    r441 r452  
    55datatype.unknow=(804) unknow datatype %1$s  on %2$s (file %3$s) 
    66invalid.xml.file=(805) invalid xml syntax in jforms file (file %s) 
     7 
     8js.err.invalid= "%s" field is invalid 
     9js.err.required= "%s" field is required 
     10 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_US/formserr.UTF-8.properties

    r441 r452  
    55datatype.unknow=(804) unknow datatype %1$s  on %2$s (file %3$s) 
    66invalid.xml.file=(805) invalid xml syntax in jforms file (file %s) 
     7 
     8js.err.invalid= "%s" field is invalid 
     9js.err.required= "%s" field is required 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_US/formserr.UTF-8.properties

    r441 r452  
    55datatype.unknow=(804) unknow datatype %1$s  on %2$s (file %3$s) 
    66invalid.xml.file=(805) invalid xml syntax in jforms file (file %s) 
     7 
     8js.err.invalid= "%s" field is invalid 
     9js.err.required= "%s" field is required 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/fr_FR/formserr.ISO-8859-1.properties

    r441 r452  
    66invalid.xml.file=(805) erreur de syntaxe xml dans un fichier jforms (fichier %s) 
    77 
     8js.err.invalid=La saisie de "%s" est invalide 
     9js.err.required=La saisie de "%s" est obligatoire 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/fr_FR/formserr.ISO-8859-1.properties

    r441 r452  
    66invalid.xml.file=(805) erreur de syntaxe xml dans un fichier jforms (fichier %s) 
    77 
     8js.err.invalid=La saisie de "%s" est invalide 
     9js.err.required=La saisie de "%s" est obligatoire 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/fr_FR/formserr.UTF-8.properties

    r441 r452  
    55datatype.unknow=(804) datatype inconnu %1$s sur %2$s (fichier %3$s) 
    66invalid.xml.file=(805) erreur de syntaxe xml dans un fichier jforms (fichier %s) 
     7 
     8js.err.invalid=La saisie de "%s" est invalide 
     9js.err.required=La saisie de "%s" est obligatoire 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/fr_FR/formserr.UTF-8.properties

    r441 r452  
    55datatype.unknow=(804) datatype inconnu %1$s sur %2$s (fichier %3$s) 
    66invalid.xml.file=(805) erreur de syntaxe xml dans un fichier jforms (fichier %s) 
     7 
     8js.err.invalid=La saisie de "%s" est invalide 
     9js.err.required=La saisie de "%s" est obligatoire 
  • branches/experimental/jforms/lib/jelix-www/js/jforms.js

    r437 r452  
    166166    _getValue : function (elt){ 
    167167        var value=''; 
    168         switch (elt.localName) { 
     168        switch (elt.localName.toLowerCase()) { 
    169169            case "input": 
    170                 switch (elt.type) { 
    171                     case "text": 
    172                     case "password": 
    173                     case "hidden": 
    174                         value = elt.value; 
    175                         break; 
    176                     case "checkbox": 
    177                     case "radio": 
    178                         if (elt.checked) 
    179                             value = 'true'; 
    180                         else 
    181                             value = 'false'; 
    182                         break; 
     170                switch (elt.getAttribute("type")) { 
     171                case "checkbox": 
     172                case "radio": 
     173                    if (elt.checked) 
     174                        value = 'true'; 
     175                    else 
     176                        value = 'false'; 
     177                    break; 
     178                default: 
     179                    value = elt.value; 
     180                    break; 
    183181                } 
    184182                break; 
    185  
    186183            case "textarea": 
    187184                value= elt.value; 
  • branches/experimental/jforms/lib/jelix-www/js/jforms.js

    r437 r452  
    166166    _getValue : function (elt){ 
    167167        var value=''; 
    168         switch (elt.localName) { 
     168        switch (elt.localName.toLowerCase()) { 
    169169            case "input": 
    170                 switch (elt.type) { 
    171                     case "text": 
    172                     case "password": 
    173                     case "hidden": 
    174                         value = elt.value; 
    175                         break; 
    176                     case "checkbox": 
    177                     case "radio": 
    178                         if (elt.checked) 
    179                             value = 'true'; 
    180                         else 
    181                             value = 'false'; 
    182                         break; 
     170                switch (elt.getAttribute("type")) { 
     171                case "checkbox": 
     172                case "radio": 
     173                    if (elt.checked) 
     174                        value = 'true'; 
     175                    else 
     176                        value = 'false'; 
     177                    break; 
     178                default: 
     179                    value = elt.value; 
     180                    break; 
    183181                } 
    184182                break; 
    185  
    186183            case "textarea": 
    187184                value= elt.value; 
  • branches/experimental/jforms/lib/jelix/forms/jFormsBuilderBase.class.php

    r442 r452  
    5757    public function getName(){ return  $this->_name; } 
    5858 
    59     abstract public function outputHeader(); 
     59    abstract public function outputHeader($params); 
    6060 
    6161    abstract public function outputFooter(); 
     
    7373abstract class jFormsHtmlBuilderBase extends  jFormsBuilderBase { 
    7474 
    75     public function outputHeader(){ 
     75    public function outputHeader($params){ 
    7676        $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
    77  
    78         echo '<form action="'.$url->scriptName . $url->pathInfo.'" method="POST" name="'. $this->_name.'">'; 
     77        echo '<form action="'.$url->scriptName . $url->pathInfo.'" method="POST" name="'. $this->_name.'" onsubmit="return jForms.verifyForm(this)">'; 
    7978        if(count($url->params)){ 
    8079            echo '<div>'; 
     
    8483            echo '</div>'; 
    8584        } 
     85        echo '<script type="text/javascript">  
     86//<[CDATA[ 
     87', $this->getJavascriptCheck($params),' 
     88//]]> 
     89</script>'; 
    8690 
    8791    } 
     
    102106 
    103107    public function outputControl($ctrl){ 
    104         $id = 'name="'.$ctrl->ref.'" id="'$this->_name.'_'.$ctrl->ref.'"'; 
     108        $id = 'name="'.$ctrl->ref.'" id="'.$this->_name.'_'.$ctrl->ref.'"'; 
    105109        $readonly = ($ctrl->readonly?' readonly="readonly"':''); 
    106110        switch($ctrl->type){ 
     
    132136 
    133137 
    134     abstract public function getJavascriptCheck(); 
     138    abstract public function getJavascriptCheck($params); 
    135139} 
    136140 
  • branches/experimental/jforms/lib/jelix/forms/jFormsBuilderBase.class.php

    r442 r452  
    5757    public function getName(){ return  $this->_name; } 
    5858 
    59     abstract public function outputHeader(); 
     59    abstract public function outputHeader($params); 
    6060 
    6161    abstract public function outputFooter(); 
     
    7373abstract class jFormsHtmlBuilderBase extends  jFormsBuilderBase { 
    7474 
    75     public function outputHeader(){ 
     75    public function outputHeader($params){ 
    7676        $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
    77  
    78         echo '<form action="'.$url->scriptName . $url->pathInfo.'" method="POST" name="'. $this->_name.'">'; 
     77        echo '<form action="'.$url->scriptName . $url->pathInfo.'" method="POST" name="'. $this->_name.'" onsubmit="return jForms.verifyForm(this)">'; 
    7978        if(count($url->params)){ 
    8079            echo '<div>'; 
     
    8483            echo '</div>'; 
    8584        } 
     85        echo '<script type="text/javascript">  
     86//<[CDATA[ 
     87', $this->getJavascriptCheck($params),' 
     88//]]> 
     89</script>'; 
    8690 
    8791    } 
     
    102106 
    103107    public function outputControl($ctrl){ 
    104         $id = 'name="'.$ctrl->ref.'" id="'$this->_name.'_'.$ctrl->ref.'"'; 
     108        $id = 'name="'.$ctrl->ref.'" id="'.$this->_name.'_'.$ctrl->ref.'"'; 
    105109        $readonly = ($ctrl->readonly?' readonly="readonly"':''); 
    106110        switch($ctrl->type){ 
     
    132136 
    133137 
    134     abstract public function getJavascriptCheck(); 
     138    abstract public function getJavascriptCheck($params); 
    135139} 
    136140 
  • branches/experimental/jforms/lib/jelix/forms/jFormsCompiler.class.php

    r442 r452  
    6363      $srcjs=array(); 
    6464      $srcjs[]='$js="gForm = new jFormsForm(\'".$this->_name."\');\n";'; 
    65       $srcjs[]='$js.="gForm.setDecorator(new jFormsErrorDecoratorAlert());\n";'; 
     65      $srcjs[]='$js.="gForm.setDecorator(new ".$errorDecoratorName."());\n";'; 
    6666      foreach($xml->children() as $controltype=>$control){ 
    6767            $source[] = $this->generatePHPControl($controltype, $control); 
     
    7777      $srcjs[]='$js.="jForms.declareForm(gForm);\n";'; 
    7878 
    79       $srcHtmlBuilder[]=' public function getJavascriptCheck(){'; 
     79      $srcHtmlBuilder[]=' public function getJavascriptCheck($errorDecoratorName){'; 
    8080      $srcHtmlBuilder[]= implode("\n", $srcjs); 
    81       $srcHtmlBuilder[]=' return $verif; }'; 
     81      $srcHtmlBuilder[]=' return $js; }'; 
    8282      $srcHtmlBuilder[]='} ?>'; 
    8383 
     
    184184 
    185185        if(isset($control->label['locale'])){ 
    186             $label='\'".str_replace("\'","\\\'",jLocale::get(\''.(string)$control->label['locale'].'\'))."\''; 
     186            $source[]='$label = str_replace("\'","\\\'",jLocale::get(\''.(string)$control->label['locale'].'\'));'; 
    187187        }else{ 
    188             $label="'".str_replace("'","\\'",(string)$control->label)."'"; 
    189             $label=str_replace('"','\"',$label); 
     188            $source[]='$label = str_replace("\'","\\\'",\''.str_replace("'","\\'",(string)$control->label).'\');'; 
    190189        } 
    191         $source[]='$js.="gControl = new jFormsControl(\''.(string)$control['ref'].'\', '.$label.', \''.$dt.'\');\n";'; 
    192  
     190        $source[]='$js.="gControl = new jFormsControl(\''.(string)$control['ref'].'\', \'".$label."\', \''.$dt.'\');\n";'; 
    193191 
    194192        if(isset($control['readonly'])){ 
     
    200198            $source[]='$js.="gControl.required = '.($required=='true'?'true':'false').';\n";'; 
    201199        } 
     200 
     201        $source[]='$js.="gControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n";'; 
     202        $source[]='$js.="gControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n";'; 
    202203 
    203204/* 
  • branches/experimental/jforms/lib/jelix/forms/jFormsCompiler.class.php

    r442 r452  
    6363      $srcjs=array(); 
    6464      $srcjs[]='$js="gForm = new jFormsForm(\'".$this->_name."\');\n";'; 
    65       $srcjs[]='$js.="gForm.setDecorator(new jFormsErrorDecoratorAlert());\n";'; 
     65      $srcjs[]='$js.="gForm.setDecorator(new ".$errorDecoratorName."());\n";'; 
    6666      foreach($xml->children() as $controltype=>$control){ 
    6767            $source[] = $this->generatePHPControl($controltype, $control); 
     
    7777      $srcjs[]='$js.="jForms.declareForm(gForm);\n";'; 
    7878 
    79       $srcHtmlBuilder[]=' public function getJavascriptCheck(){'; 
     79      $srcHtmlBuilder[]=' public function getJavascriptCheck($errorDecoratorName){'; 
    8080      $srcHtmlBuilder[]= implode("\n", $srcjs); 
    81       $srcHtmlBuilder[]=' return $verif; }'; 
     81      $srcHtmlBuilder[]=' return $js; }'; 
    8282      $srcHtmlBuilder[]='} ?>'; 
    8383 
     
    184184 
    185185        if(isset($control->label['locale'])){ 
    186             $label='\'".str_replace("\'","\\\'",jLocale::get(\''.(string)$control->label['locale'].'\'))."\''; 
     186            $source[]='$label = str_replace("\'","\\\'",jLocale::get(\''.(string)$control->label['locale'].'\'));'; 
    187187        }else{ 
    188             $label="'".str_replace("'","\\'",(string)$control->label)."'"; 
    189             $label=str_replace('"','\"',$label); 
     188            $source[]='$label = str_replace("\'","\\\'",\''.str_replace("'","\\'",(string)$control->label).'\');'; 
    190189        } 
    191         $source[]='$js.="gControl = new jFormsControl(\''.(string)$control['ref'].'\', '.$label.', \''.$dt.'\');\n";'; 
    192  
     190        $source[]='$js.="gControl = new jFormsControl(\''.(string)$control['ref'].'\', \'".$label."\', \''.$dt.'\');\n";'; 
    193191 
    194192        if(isset($control['readonly'])){ 
     
    200198            $source[]='$js.="gControl.required = '.($required=='true'?'true':'false').';\n";'; 
    201199        } 
     200 
     201        $source[]='$js.="gControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n";'; 
     202        $source[]='$js.="gControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n";'; 
    202203 
    203204/* 
  • branches/experimental/jforms/lib/jelix/tpl/plugins/html/block.form.php

    r442 r452  
    1313 * 
    1414 * usage : {form $theformobject,'submit_action', $submit_action_params} here form content {/form} 
    15  *     
     15 * 
    1616 * @param jTplCompiler $compiler the template compiler 
    17  * @param boolean true if it is the begin of block, else false 
    18  * @param $param array  0=>form object 1=>selector of submit action  2=>array of parameters for submit action 
     17 * @param boolean $begin true if it is the begin of block, else false 
     18 * @param array $param 0=>form object  
     19 *                     1=>selector of submit action   
     20 *                     2=>array of parameters for submit action  
     21 *                     3=>name of your javascript object for error listener 
    1922 * @return string the php code corresponding to the begin or end of the block 
    2023 * @see jForms 
     
    2932    } 
    3033 
    31     if(count($param) < 2 || count($param) > 3){ 
     34    if(count($param) < 2 || count($param) > 4){ 
    3235        $compiler->doError2('errors.tplplugin.block.bad.argument.number','form',2); 
    3336        return ''; 
     
    3740    } 
    3841 
     42    if(isset($param[3])) 
     43        $errdecorator = $param[3]; 
     44    else 
     45        $errdecorator = "'jFormsErrorDecoratorAlert'"; 
     46 
    3947    $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 
    4048$t->_privateVars[\'__builder\'] = $t->_privateVars[\'__form\']->getBuilder(\'html\', '.$param[1].','.$param[2].'); 
    41 $t->_privateVars[\'__builder\']->outputHeader(); 
     49$t->_privateVars[\'__builder\']->outputHeader('.$errdecorator.'); 
     50if($GLOBALS[\'gJCoord\']->response!= null){ 
     51    $GLOBALS[\'gJCoord\']->response->addJSLink($GLOBALS[\'gJConfig\']->urlengine[\'basePath\'].\'jelix/js/jforms.js\'); 
     52
    4253'; 
    43  
    44     $rep = $GLOBALS['gJCoord']->response; 
    45     if($rep!= null){ 
    46         $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'jelix/js/jforms.js'); 
    47     } 
    4854 
    4955    return $content; 
  • branches/experimental/jforms/lib/jelix/tpl/plugins/html/block.form.php

    r442 r452  
    1313 * 
    1414 * usage : {form $theformobject,'submit_action', $submit_action_params} here form content {/form} 
    15  *     
     15 * 
    1616 * @param jTplCompiler $compiler the template compiler 
    17  * @param boolean true if it is the begin of block, else false 
    18  * @param $param array  0=>form object 1=>selector of submit action  2=>array of parameters for submit action 
     17 * @param boolean $begin true if it is the begin of block, else false 
     18 * @param array $param 0=>form object  
     19 *                     1=>selector of submit action   
     20 *                     2=>array of parameters for submit action  
     21 *                     3=>name of your javascript object for error listener 
    1922 * @return string the php code corresponding to the begin or end of the block 
    2023 * @see jForms 
     
    2932    } 
    3033 
    31     if(count($param) < 2 || count($param) > 3){ 
     34    if(count($param) < 2 || count($param) > 4){ 
    3235        $compiler->doError2('errors.tplplugin.block.bad.argument.number','form',2); 
    3336        return ''; 
     
    3740    } 
    3841 
     42    if(isset($param[3])) 
     43        $errdecorator = $param[3]; 
     44    else 
     45        $errdecorator = "'jFormsErrorDecoratorAlert'"; 
     46 
    3947    $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 
    4048$t->_privateVars[\'__builder\'] = $t->_privateVars[\'__form\']->getBuilder(\'html\', '.$param[1].','.$param[2].'); 
    41 $t->_privateVars[\'__builder\']->outputHeader(); 
     49$t->_privateVars[\'__builder\']->outputHeader('.$errdecorator.'); 
     50if($GLOBALS[\'gJCoord\']->response!= null){ 
     51    $GLOBALS[\'gJCoord\']->response->addJSLink($GLOBALS[\'gJConfig\']->urlengine[\'basePath\'].\'jelix/js/jforms.js\'); 
     52
    4253'; 
    43  
    44     $rep = $GLOBALS['gJCoord']->response; 
    45     if($rep!= null){ 
    46         $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'jelix/js/jforms.js'); 
    47     } 
    4854 
    4955    return $content; 
  • branches/experimental/jforms/lib/jelix/tpl/plugins/html/block.formcontrols.php

    r442 r452  
    1515 *  
    1616 * @param jTplCompiler $compiler the template compiler 
    17  * @param boolean true if it is the begin of block, else false 
    18  * @param $param array  empty or a jFormBase object as first item 
     17 * @param boolean $begin true if it is the begin of block, else false 
     18 * @param array $param array  empty or a jFormBase object as first item 
    1919 * @return string the php code corresponding to the begin or end of the block 
    2020 * @see jForms 
  • branches/experimental/jforms/lib/jelix/tpl/plugins/html/block.formcontrols.php

    r442 r452  
    1515 *  
    1616 * @param jTplCompiler $compiler the template compiler 
    17  * @param boolean true if it is the begin of block, else false 
    18  * @param $param array  empty or a jFormBase object as first item 
     17 * @param boolean $begin true if it is the begin of block, else false 
     18 * @param array $param array  empty or a jFormBase object as first item 
    1919 * @return string the php code corresponding to the begin or end of the block 
    2020 * @see jForms 
  • branches/experimental/jforms/testapp/modules/testapp/forms/sample.form.xml

    r442 r452  
    22<forms xmlns="http://jelix.org/ns/forms/1.0"> 
    33 
    4    <input ref="nom"
     4   <input ref="nom" required="true"
    55      <label>Votre nom</label> 
    66   </input> 
  • branches/experimental/jforms/testapp/modules/testapp/forms/sample.form.xml

    r442 r452  
    22<forms xmlns="http://jelix.org/ns/forms/1.0"> 
    33 
    4    <input ref="nom"
     4   <input ref="nom" required="true"
    55      <label>Votre nom</label> 
    66   </input> 
  • branches/experimental/jforms/testapp/modules/testapp/templates/sampleform.tpl

    r442 r452  
    11<h1>Test de formulaire</h1> 
    22<p>Voici un formulaire de test</p> 
    3 {form $form,'sampleform_save'} 
     3<script type="text/javascript"> 
     4{literal} 
     5function myErrorDecorator(){ 
     6    this.message = ''; 
     7
     8 
     9myErrorDecorator.prototype = { 
     10    start : function(){ 
     11        this.message = ''; 
     12    }, 
     13    addError : function(control, messageType){ 
     14        if(messageType == 1){ 
     15            this.message  += control.errRequired + "\n"; 
     16        }else if(messageType == 2){ 
     17            this.message  += control.errInvalid + "\n"; 
     18        } 
     19    }, 
     20    end : function(){ 
     21        if(this.message != ''){ 
     22            alert("Erreur de saisie:\n" + this.message); 
     23        } 
     24    } 
     25
     26{/literal} 
     27</script> 
     28 
     29{form $form,'sampleform_save', array(), 'myErrorDecorator'} 
    430<fieldset> 
    531   <legend>Votre identité</legend> 
  • branches/experimental/jforms/testapp/modules/testapp/templates/sampleform.tpl

    r442 r452  
    11<h1>Test de formulaire</h1> 
    22<p>Voici un formulaire de test</p> 
    3 {form $form,'sampleform_save'} 
     3<script type="text/javascript"> 
     4{literal} 
     5function myErrorDecorator(){ 
     6    this.message = ''; 
     7
     8 
     9myErrorDecorator.prototype = { 
     10    start : function(){ 
     11        this.message = ''; 
     12    }, 
     13    addError : function(control, messageType){ 
     14        if(messageType == 1){ 
     15            this.message  += control.errRequired + "\n"; 
     16        }else if(messageType == 2){ 
     17            this.message  += control.errInvalid + "\n"; 
     18        } 
     19    }, 
     20    end : function(){ 
     21        if(this.message != ''){ 
     22            alert("Erreur de saisie:\n" + this.message); 
     23        } 
     24    } 
     25
     26{/literal} 
     27</script> 
     28 
     29{form $form,'sampleform_save', array(), 'myErrorDecorator'} 
    430<fieldset> 
    531   <legend>Votre identité</legend> 
Download in other formats: Unified Diff Zip Archive