Changeset 1069
- Timestamp:
- 08/27/08 23:57:27 (3 months ago)
- Files:
-
- trunk/lib/jelix-www/js/jforms.js (modified) (4 diffs)
- trunk/lib/jelix/plugins/jforms/html/html.jformsbuilder.php (modified) (14 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (76 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder2.html_cli.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix-www/js/jforms.js
r1054 r1069 17 17 18 18 // declare a form control 19 jForms.tControl= new jFormsControl('name', 'a label', 'datatype');20 jForms.tControl.required = true;21 jForms.tControl.errInvalid='';22 jForms.tControl.errRequired='';23 jForms.tForm.addControl( gControl);19 var c = new jFormsControl('name', 'a label', 'datatype'); 20 c.required = true; 21 c.errInvalid=''; 22 c.errRequired=''; 23 jForms.tForm.addControl(c); 24 24 ... 25 25 26 // declare the form now 26 // declare the form now. A 'submit" event handler will be attached to the corresponding form element 27 27 jForms.declareForm(jForms.tForm); 28 29 //On a form tag, you should add this onsubmit attribute :30 onsubmit="return jForms.verifyForm(this)"31 28 32 29 */ … … 39 36 40 37 tForm: null, 41 tControl: null,42 tControl2: null,43 38 frmElt: null, 44 39 … … 611 606 612 607 var list = this.items[val]; 608 var valid = true; 613 609 for(var i=0; i < list.length; i++) { 614 610 var val2 = jfrm.getValue(jfrm.frmElt.elements[list[i].name]); … … 617 613 if (list[i].required) { 618 614 jfrm.tForm.errorDecorator.addError(list[i], 1); 615 valid = false; 619 616 } 620 617 } else if (!list[i].check(val2, jfrm)) { 621 618 jfrm.tForm.errorDecorator.addError(list[i], 2); 622 } 623 } 624 return true; 619 valid = false; 620 } 621 } 622 return valid; 625 623 }, 626 624 activate : function (val) { trunk/lib/jelix/plugins/jforms/html/html.jformsbuilder.php
r1067 r1069 158 158 echo '<script type="text/javascript"> 159 159 //<![CDATA[ 160 (function(){var c, c2; 160 161 '.$this->jsContent.' 162 })(); 161 163 //]]> 162 164 </script>'; … … 192 194 } 193 195 196 protected function escJsStr($str) { 197 return '\''.str_replace(array("'","\n"),array("\\'", "\\n"), $str).'\''; 198 } 199 194 200 protected function commonJs($ctrl) { 195 201 if($ctrl->help){ 196 $this->jsContent .=" jForms.tControl.help='".str_replace("'","\\'",$ctrl->help)."';\n";202 $this->jsContent .="c.help=".$this->escJsStr($ctrl->help).";\n"; 197 203 } 198 204 199 205 if($ctrl->required){ 200 $this->jsContent .=" jForms.tControl.required = true;\n";206 $this->jsContent .="c.required = true;\n"; 201 207 if($ctrl->alertRequired){ 202 $this->jsContent .=" jForms.tControl.errRequired='".str_replace("'","\\'",$ctrl->alertRequired)."';\n";208 $this->jsContent .="c.errRequired=".$this->escJsStr($ctrl->alertRequired).";\n"; 203 209 } 204 210 else { 205 $this->jsContent .=" jForms.tControl.errRequired='".str_replace("'","\\'",jLocale::get('jelix~formserr.js.err.required', $ctrl->label))."';\n";211 $this->jsContent .="c.errRequired=".$this->escJsStr(jLocale::get('jelix~formserr.js.err.required', $ctrl->label)).";\n"; 206 212 } 207 213 } 208 214 209 215 if($ctrl->alertInvalid){ 210 $this->jsContent .=" jForms.tControl.errInvalid='".str_replace("'","\\'",$ctrl->alertInvalid)."';\n";216 $this->jsContent .="c.errInvalid=".$this->escJsStr($ctrl->alertInvalid).";\n"; 211 217 } 212 218 else { 213 $this->jsContent .=" jForms.tControl.errInvalid='".str_replace("'","\\'",jLocale::get('jelix~formserr.js.err.invalid', $ctrl->label))."';\n";214 } 215 216 if ($this->isRootControl) $this->jsContent .="jForms.tForm.addControl( jForms.tControl);\n";219 $this->jsContent .="c.errInvalid=".$this->escJsStr(jLocale::get('jelix~formserr.js.err.invalid', $ctrl->label)).";\n"; 220 } 221 222 if ($this->isRootControl) $this->jsContent .="jForms.tForm.addControl(c);\n"; 217 223 } 218 224 … … 245 251 $dt = 'String'; 246 252 247 $this->jsContent .=" jForms.tControl = new jFormsControl".$dt."('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n";253 $this->jsContent .="c = new jFormsControl".$dt."('".$ctrl->ref."', ".$this->escJsStr($ctrl->label).");\n"; 248 254 if ($isLocale) 249 $this->jsContent .=" jForms.tControl.lang='".$GLOBALS['gJConfig']->locale."';\n";255 $this->jsContent .="c.lang='".$GLOBALS['gJConfig']->locale."';\n"; 250 256 251 257 $maxl= $ctrl->datatype->getFacet('maxLength'); 252 258 if($maxl !== null) 253 $this->jsContent .=" jForms.tControl.maxLength = '$maxl';\n";259 $this->jsContent .="c.maxLength = '$maxl';\n"; 254 260 255 261 $minl= $ctrl->datatype->getFacet('minLength'); 256 262 if($minl !== null) 257 $this->jsContent .=" jForms.tControl.minLength = '$minl';\n";263 $this->jsContent .="c.minLength = '$minl';\n"; 258 264 259 265 $this->commonJs($ctrl); … … 273 279 protected function jsCheckbox($ctrl) { 274 280 275 $this->jsContent .=" jForms.tControl = new jFormsControlBoolean('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n";281 $this->jsContent .="c = new jFormsControlBoolean('".$ctrl->ref."', ".$this->escJsStr($ctrl->label).");\n"; 276 282 277 283 $this->commonJs($ctrl); … … 309 315 protected function jsCheckboxes($ctrl) { 310 316 311 $this->jsContent .=" jForms.tControl = new jFormsControlString('".$ctrl->ref."[]', '".str_replace("'","\'",$ctrl->label)."');\n";317 $this->jsContent .="c = new jFormsControlString('".$ctrl->ref."[]', ".$this->escJsStr($ctrl->label).");\n"; 312 318 313 319 $this->commonJs($ctrl); … … 334 340 protected function jsRadiobuttons($ctrl) { 335 341 336 $this->jsContent .=" jForms.tControl = new jFormsControlString('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n";342 $this->jsContent .="c = new jFormsControlString('".$ctrl->ref."', ".$this->escJsStr($ctrl->label).");\n"; 337 343 338 344 $this->commonJs($ctrl); … … 359 365 protected function jsMenulist($ctrl) { 360 366 361 $this->jsContent .=" jForms.tControl = new jFormsControlString('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n";367 $this->jsContent .="c = new jFormsControlString('".$ctrl->ref."', ".$this->escJsStr($ctrl->label).");\n"; 362 368 363 369 $this->commonJs($ctrl); … … 402 408 protected function jsListbox($ctrl) { 403 409 if($ctrl->multiple){ 404 $this->jsContent .= " jForms.tControl = new jFormsControlString('".$ctrl->ref."[]', '".str_replace("'","\'",$ctrl->label)."');\n";405 $this->jsContent .= " jForms.tControl.multiple = true;\n";410 $this->jsContent .= "c = new jFormsControlString('".$ctrl->ref."[]', ".$this->escJsStr($ctrl->label).");\n"; 411 $this->jsContent .= "c.multiple = true;\n"; 406 412 } else { 407 $this->jsContent .=" jForms.tControl = new jFormsControlString('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n";413 $this->jsContent .="c = new jFormsControlString('".$ctrl->ref."', ".$this->escJsStr($ctrl->label).");\n"; 408 414 } 409 415 … … 418 424 419 425 protected function jsTextarea($ctrl) { 420 $this->jsContent .=" jForms.tControl = new jFormsControlString('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n";426 $this->jsContent .="c = new jFormsControlString('".$ctrl->ref."', ".$this->escJsStr($ctrl->label).");\n"; 421 427 422 428 $maxl= $ctrl->datatype->getFacet('maxLength'); 423 429 if($maxl !== null) 424 $this->jsContent .=" jForms.tControl.maxLength = '$maxl';\n";430 $this->jsContent .="c.maxLength = '$maxl';\n"; 425 431 426 432 $minl= $ctrl->datatype->getFacet('minLength'); 427 433 if($minl !== null) 428 $this->jsContent .=" jForms.tControl.minLength = '$minl';\n";434 $this->jsContent .="c.minLength = '$minl';\n"; 429 435 430 436 $this->commonJs($ctrl); … … 464 470 protected function jsSecretconfirm($ctrl) { 465 471 // we assume that a secret confirm control is just after a secret control in the list of controls 466 $this->jsContent .= " jForms.tControl.confirmField = new jFormsControlSecretConfirm('".$ctrl->ref."_confirm', '".str_replace("'","\\'",$ctrl->label)."');\n";472 $this->jsContent .= "c.confirmField = new jFormsControlSecretConfirm('".$ctrl->ref."_confirm', ".$this->escJsStr($ctrl->label).");\n"; 467 473 } 468 474 … … 485 491 486 492 protected function jsUpload($ctrl) { 487 $this->jsContent .=" jForms.tControl = new jFormsControlString('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n";493 $this->jsContent .="c = new jFormsControlString('".$ctrl->ref."', ".$this->escJsStr($ctrl->label).");\n"; 488 494 489 495 $this->commonJs($ctrl); … … 557 563 $id=' name="'.$ctrl->ref.'" id="'.$this->_name.'_'.$ctrl->ref.'_'; 558 564 $this->jsChoiceInternal($ctrl); 559 $this->jsContent .=" jForms.tControl2 = jForms.tControl;\n";565 $this->jsContent .="c2 = c;\n"; 560 566 $this->isRootControl = false; 561 567 foreach( $ctrl->items as $itemName=>$listctrl){ … … 579 585 if($ro) $c->setReadOnly(true); 580 586 echo "</span>\n"; 581 $this->jsContent .=" jForms.tControl2.addControl(jForms.tControl, '".str_replace("'","\\'",$itemName)."');\n";587 $this->jsContent .="c2.addControl(c, ".$this->escJsStr($itemName).");\n"; 582 588 } 583 589 if(!$displayedControls) { 584 $this->jsContent .=" jForms.tControl2.items['".str_replace("'","\\'",$itemName)."']=[];\n";590 $this->jsContent .="c2.items[".$this->escJsStr($itemName)."]=[];\n"; 585 591 } 586 592 … … 600 606 $value=''; 601 607 } 602 $this->jsContent .= " jForms.tControl2.activate('".$value."');\n";608 $this->jsContent .= "c2.activate('".$value."');\n"; 603 609 } 604 610 605 611 protected function jsChoiceInternal($ctrl) { 606 612 607 $this->jsContent .=" jForms.tControl = new jFormsControlChoice('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n";613 $this->jsContent .="c = new jFormsControlChoice('".$ctrl->ref."', ".$this->escJsStr($ctrl->label).");\n"; 608 614 609 615 $this->commonJs($ctrl); trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php
r1063 r1069 81 81 $this->assertEqualOrDiff('<script type="text/javascript"> 82 82 //<![CDATA[ 83 83 (function(){var c, c2; 84 85 })(); 84 86 //]]> 85 87 </script></form>', $out); … … 96 98 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 97 99 $this->assertEqualOrDiff('<input type="text" name="input1" id="'.$this->formname.'_input1" value=""/>', $out); 98 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'input1\', \'Votre nom\');99 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';100 jForms.tForm.addControl( jForms.tControl);100 $this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\'); 101 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 102 jForms.tForm.addControl(c); 101 103 ', $this->builder->getJsContent()); 102 104 … … 104 106 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 105 107 $this->assertEqualOrDiff('<input type="text" name="input1" id="'.$this->formname.'_input1" value="toto"/>', $out); 106 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'input1\', \'Votre nom\');107 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';108 jForms.tForm.addControl( jForms.tControl);108 $this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\'); 109 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 110 jForms.tForm.addControl(c); 109 111 ', $this->builder->getJsContent()); 110 112 … … 112 114 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 113 115 $this->assertEqualOrDiff('<input type="text" name="input1" id="'.$this->formname.'_input1" value="toto"/>', $out); 114 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'input1\', \'Votre nom\');115 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';116 jForms.tForm.addControl( jForms.tControl);116 $this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\'); 117 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 118 jForms.tForm.addControl(c); 117 119 ', $this->builder->getJsContent()); 118 120 … … 121 123 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 122 124 $this->assertEqualOrDiff('<input type="text" name="input1" id="'.$this->formname.'_input1" value="laurent"/>', $out); 123 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'input1\', \'Votre nom\');124 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';125 jForms.tForm.addControl( jForms.tControl);125 $this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\'); 126 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 127 jForms.tForm.addControl(c); 126 128 ', $this->builder->getJsContent()); 127 129 … … 129 131 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 130 132 $this->assertEqualOrDiff('<input type="text" name="input1" id="'.$this->formname.'_input1" class=" jforms-required" value="laurent"/>', $out); 131 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'input1\', \'Votre nom\');132 jForms.tControl.required = true;133 jForms.tControl.errRequired=\'La saisie de "Votre nom" est obligatoire\';134 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';135 jForms.tForm.addControl( jForms.tControl);133 $this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\'); 134 c.required = true; 135 c.errRequired=\'La saisie de "Votre nom" est obligatoire\'; 136 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 137 jForms.tForm.addControl(c); 136 138 ', $this->builder->getJsContent()); 137 139 … … 141 143 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 142 144 $this->assertEqualOrDiff('<input type="text" name="input1" id="'.$this->formname.'_input1" readonly="readonly" class=" jforms-readonly" value="laurent"/>', $out); 143 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'input1\', \'Votre nom\');144 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';145 jForms.tForm.addControl( jForms.tControl);145 $this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\'); 146 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 147 jForms.tForm.addControl(c); 146 148 ', $this->builder->getJsContent()); 147 149 … … 151 153 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 152 154 $this->assertEqualOrDiff('<input type="text" name="input1" id="'.$this->formname.'_input1" value="laurent"/><span class="jforms-help"><a href="javascript:jForms.showHelp(\''. $this->formname.'\',\'input1\')">?</a></span>', $out); 153 $this->assertEqualOrDiff('jForms.tControl = new jFormsControlString(\'input1\', \'Votre nom\'); 154 jForms.tControl.help=\'some help\'; 155 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\'; 156 jForms.tForm.addControl(jForms.tControl); 157 ', $this->builder->getJsContent()); 158 155 $this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\'); 156 c.help=\'some help\'; 157 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 158 jForms.tForm.addControl(c); 159 ', $this->builder->getJsContent()); 160 161 162 $ctrl->help='some 163 help with \' and 164 line break.'; 165 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 166 $this->assertEqualOrDiff('<input type="text" name="input1" id="'.$this->formname.'_input1" value="laurent"/><span class="jforms-help"><a href="javascript:jForms.showHelp(\''. $this->formname.'\',\'input1\')">?</a></span>', $out); 167 $this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\'); 168 c.help=\'some \nhelp with \\\' and\nline break.\'; 169 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 170 jForms.tForm.addControl(c); 171 ', $this->builder->getJsContent()); 159 172 160 173 $ctrl->hint='ceci est un tooltip'; 174 $ctrl->help='some help'; 161 175 ob_start();$this->builder->outputControlLabel($ctrl);$out = ob_get_clean(); 162 176 $this->assertEqualOrDiff('<label class="jforms-label" for="'.$this->formname.'_input1" title="ceci est un tooltip">Votre nom</label>', $out); … … 164 178 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 165 179 $this->assertEqualOrDiff('<input type="text" name="input1" id="'.$this->formname.'_input1" title="ceci est un tooltip" value="laurent"/><span class="jforms-help"><a href="javascript:jForms.showHelp(\''. $this->formname.'\',\'input1\')">?</a></span>', $out); 166 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'input1\', \'Votre nom\');167 jForms.tControl.help=\'some help\';168 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';169 jForms.tForm.addControl( jForms.tControl);180 $this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\'); 181 c.help=\'some help\'; 182 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 183 jForms.tForm.addControl(c); 170 184 ', $this->builder->getJsContent()); 171 185 … … 176 190 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 177 191 $this->assertEqualOrDiff('<input type="text" name="input1" id="'.$this->formname.'_input1" maxlength="5" value="laurent"/>', $out); 178 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'input1\', \'Votre nom\');179 jForms.tControl.maxLength = \'5\';180 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';181 jForms.tForm.addControl( jForms.tControl);192 $this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\'); 193 c.maxLength = \'5\'; 194 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 195 jForms.tForm.addControl(c); 182 196 ', $this->builder->getJsContent()); 183 197 … … 194 208 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 195 209 $this->assertEqualOrDiff('<input type="checkbox" name="chk1" id="'.$this->formname.'_chk1" value="1"/>', $out); 196 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlBoolean(\'chk1\', \'Une option\');197 jForms.tControl.errInvalid=\'La saisie de "Une option" est invalide\';198 jForms.tForm.addControl( jForms.tControl);210 $this->assertEqualOrDiff('c = new jFormsControlBoolean(\'chk1\', \'Une option\'); 211 c.errInvalid=\'La saisie de "Une option" est invalide\'; 212 jForms.tForm.addControl(c); 199 213 ', $this->builder->getJsContent()); 200 214 … … 203 217 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 204 218 $this->assertEqualOrDiff('<input type="checkbox" name="chk1" id="'.$this->formname.'_chk1" checked="checked" value="1"/>', $out); 205 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlBoolean(\'chk1\', \'Une option\');206 jForms.tControl.errInvalid=\'La saisie de "Une option" est invalide\';207 jForms.tForm.addControl( jForms.tControl);219 $this->assertEqualOrDiff('c = new jFormsControlBoolean(\'chk1\', \'Une option\'); 220 c.errInvalid=\'La saisie de "Une option" est invalide\'; 221 jForms.tForm.addControl(c); 208 222 ', $this->builder->getJsContent()); 209 223 … … 218 232 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 219 233 $this->assertEqualOrDiff('<input type="checkbox" name="chk2" id="'.$this->formname.'_chk2" value="1"/>', $out); 220 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlBoolean(\'chk2\', \'Une option\');221 jForms.tControl.errInvalid=\'La saisie de "Une option" est invalide\';222 jForms.tForm.addControl( jForms.tControl);234 $this->assertEqualOrDiff('c = new jFormsControlBoolean(\'chk2\', \'Une option\'); 235 c.errInvalid=\'La saisie de "Une option" est invalide\'; 236 jForms.tForm.addControl(c); 223 237 ', $this->builder->getJsContent()); 224 238 … … 229 243 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 230 244 $this->assertEqualOrDiff('<input type="checkbox" name="chk2" id="'.$this->formname.'_chk2" checked="checked" value="1"/>', $out); 231 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlBoolean(\'chk2\', \'Une option\');232 jForms.tControl.errInvalid=\'La saisie de "Une option" est invalide\';233 jForms.tForm.addControl( jForms.tControl);245 $this->assertEqualOrDiff('c = new jFormsControlBoolean(\'chk2\', \'Une option\'); 246 c.errInvalid=\'La saisie de "Une option" est invalide\'; 247 jForms.tForm.addControl(c); 234 248 ', $this->builder->getJsContent()); 235 249 … … 237 251 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 238 252 $this->assertEqualOrDiff('<input type="checkbox" name="chk2" id="'.$this->formname.'_chk2" value="1"/>', $out); 239 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlBoolean(\'chk2\', \'Une option\');240 jForms.tControl.errInvalid=\'La saisie de "Une option" est invalide\';241 jForms.tForm.addControl( jForms.tControl);253 $this->assertEqualOrDiff('c = new jFormsControlBoolean(\'chk2\', \'Une option\'); 254 c.errInvalid=\'La saisie de "Une option" est invalide\'; 255 jForms.tForm.addControl(c); 242 256 ', $this->builder->getJsContent()); 243 257 … … 246 260 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 247 261 $this->assertEqualOrDiff('<input type="checkbox" name="chk2" id="'.$this->formname.'_chk2" readonly="readonly" class=" jforms-readonly" value="1"/>', $out); 248 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlBoolean(\'chk2\', \'Une option\');249 jForms.tControl.errInvalid=\'La saisie de "Une option" est invalide\';250 jForms.tForm.addControl( jForms.tControl);262 $this->assertEqualOrDiff('c = new jFormsControlBoolean(\'chk2\', \'Une option\'); 263 c.errInvalid=\'La saisie de "Une option" est invalide\'; 264 jForms.tForm.addControl(c); 251 265 ', $this->builder->getJsContent()); 252 266 … … 255 269 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 256 270 $this->assertEqualOrDiff('<input type="checkbox" name="chk2" id="'.$this->formname.'_chk2" readonly="readonly" class=" jforms-readonly" checked="checked" value="1"/>', $out); 257 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlBoolean(\'chk2\', \'Une option\');258 jForms.tControl.errInvalid=\'La saisie de "Une option" est invalide\';259 jForms.tForm.addControl( jForms.tControl);271 $this->assertEqualOrDiff('c = new jFormsControlBoolean(\'chk2\', \'Une option\'); 272 c.errInvalid=\'La saisie de "Une option" est invalide\'; 273 jForms.tForm.addControl(c); 260 274 ', $this->builder->getJsContent()); 261 275 … … 266 280 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 267 281 $this->assertEqualOrDiff('<input type="checkbox" name="chk2" id="'.$this->formname.'_chk2" readonly="readonly" title="ceci est un tooltip" class=" jforms-readonly" checked="checked" value="1"/>', $out); 268 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlBoolean(\'chk2\', \'Une option\');269 jForms.tControl.errInvalid=\'La saisie de "Une option" est invalide\';270 jForms.tForm.addControl( jForms.tControl);282 $this->assertEqualOrDiff('c = new jFormsControlBoolean(\'chk2\', \'Une option\'); 283 c.errInvalid=\'La saisie de "Une option" est invalide\'; 284 jForms.tForm.addControl(c); 271 285 ', $this->builder->getJsContent()); 272 286 … … 295 309 $result.='<span class="jforms-chkbox jforms-ctl-choixsimple"><input type="checkbox" name="choixsimple[]" id="'.$this->formname.'_choixsimple_2" value="23"/><label for="'.$this->formname.'_choixsimple_2">baz</label></span>'; 296 310 $this->assertEqualOrDiff($result, $out); 297 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'choixsimple[]\', \'Vos choix\');298 jForms.tControl.errInvalid=\'La saisie de "Vos choix" est invalide\';299 jForms.tForm.addControl( jForms.tControl);311 $this->assertEqualOrDiff('c = new jFormsControlString(\'choixsimple[]\', \'Vos choix\'); 312 c.errInvalid=\'La saisie de "Vos choix" est invalide\'; 313 jForms.tForm.addControl(c); 300 314 ', $this->builder->getJsContent()); 301 315 … … 307 321 $result.='<span class="jforms-chkbox jforms-ctl-choixsimple"><input type="checkbox" name="choixsimple[]" id="'.$this->formname.'_choixsimple_2" value="23"/><label for="'.$this->formname.'_choixsimple_2">baz</label></span>'; 308 322 $this->assertEqualOrDiff($result, $out); 309 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'choixsimple[]\', \'Vos choix\');310 jForms.tControl.errInvalid=\'La saisie de "Vos choix" est invalide\';311 jForms.tForm.addControl( jForms.tControl);323 $this->assertEqualOrDiff('c = new jFormsControlString(\'choixsimple[]\', \'Vos choix\'); 324 c.errInvalid=\'La saisie de "Vos choix" est invalide\'; 325 jForms.tForm.addControl(c); 312 326 ', $this->builder->getJsContent()); 313 327 … … 332 346 $result.='<span class="jforms-chkbox jforms-ctl-choixmultiple"><input type="checkbox" name="choixmultiple[]" id="'.$this->formname.'_choixmultiple_2" value="23"/><label for="'.$this->formname.'_choixmultiple_2">baz</label></span>'; 333 347 $this->assertEqualOrDiff($result, $out); 334 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'choixmultiple[]\', \'Vos choix\');335 jForms.tControl.errInvalid=\'La saisie de "Vos choix" est invalide\';336 jForms.tForm.addControl( jForms.tControl);348 $this->assertEqualOrDiff('c = new jFormsControlString(\'choixmultiple[]\', \'Vos choix\'); 349 c.errInvalid=\'La saisie de "Vos choix" est invalide\'; 350 jForms.tForm.addControl(c); 337 351 ', $this->builder->getJsContent()); 338 352 … … 344 358 $result.='<span class="jforms-chkbox jforms-ctl-choixmultiple"><input type="checkbox" name="choixmultiple[]" id="'.$this->formname.'_choixmultiple_2" value="23"/><label for="'.$this->formname.'_choixmultiple_2">baz</label></span>'; 345 359 $this->assertEqualOrDiff($result, $out); 346 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'choixmultiple[]\', \'Vos choix\');347 jForms.tControl.errInvalid=\'La saisie de "Vos choix" est invalide\';348 jForms.tForm.addControl( jForms.tControl);360 $this->assertEqualOrDiff('c = new jFormsControlString(\'choixmultiple[]\', \'Vos choix\'); 361 c.errInvalid=\'La saisie de "Vos choix" est invalide\'; 362 jForms.tForm.addControl(c); 349 363 ', $this->builder->getJsContent()); 350 364 … … 356 370 $result.='<span class="jforms-chkbox jforms-ctl-choixmultiple"><input type="checkbox" name="choixmultiple[]" id="'.$this->formname.'_choixmultiple_2" value="23" checked="checked"/><label for="'.$this->formname.'_choixmultiple_2">baz</label></span>'; 357 371 $this->assertEqualOrDiff($result, $out); 358 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'choixmultiple[]\', \'Vos choix\');359 jForms.tControl.errInvalid=\'La saisie de "Vos choix" est invalide\';360 jForms.tForm.addControl( jForms.tControl);372 $this->assertEqualOrDiff('c = new jFormsControlString(\'choixmultiple[]\', \'Vos choix\'); 373 c.errInvalid=\'La saisie de "Vos choix" est invalide\'; 374 jForms.tForm.addControl(c); 361 375 ', $this->builder->getJsContent()); 362 376 … … 372 386 $result.='<span class="jforms-chkbox jforms-ctl-choixmultiple"><input type="checkbox" name="choixmultiple[]" id="'.$this->formname.'_choixmultiple_2" value="23" checked="checked" readonly="readonly" class=" jforms-readonly"/><label for="'.$this->formname.'_choixmultiple_2">baz</label></span>'; 373 387 $this->assertEqualOrDiff($result, $out); 374 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'choixmultiple[]\', \'Vos choix\');375 jForms.tControl.errInvalid=\'La saisie de "Vos choix" est invalide\';376 jForms.tForm.addControl( jForms.tControl);388 $this->assertEqualOrDiff('c = new jFormsControlString(\'choixmultiple[]\', \'Vos choix\'); 389 c.errInvalid=\'La saisie de "Vos choix" est invalide\'; 390 jForms.tForm.addControl(c); 377 391 ', $this->builder->getJsContent()); 378 392 } … … 393 407 $result.='<span class="jforms-radio jforms-ctl-rbchoixsimple"><input type="radio" name="rbchoixsimple" id="'.$this->formname.'_rbchoixsimple_2" value="23"/><label for="'.$this->formname.'_rbchoixsimple_2">baz</label></span>'; 394 408 $this->assertEqualOrDiff($result, $out); 395 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'rbchoixsimple\', \'Votre choix\');396 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';397 jForms.tForm.addControl( jForms.tControl);409 $this->assertEqualOrDiff('c = new jFormsControlString(\'rbchoixsimple\', \'Votre choix\'); 410 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 411 jForms.tForm.addControl(c); 398 412 ', $this->builder->getJsContent()); 399 413 … … 406 420 $result.='<span class="jforms-radio jforms-ctl-rbchoixsimple"><input type="radio" name="rbchoixsimple" id="'.$this->formname.'_rbchoixsimple_2" value="23"/><label for="'.$this->formname.'_rbchoixsimple_2">baz</label></span>'; 407 421 $this->assertEqualOrDiff($result, $out); 408 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'rbchoixsimple\', \'Votre choix\');409 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';410 jForms.tForm.addControl( jForms.tControl);422 $this->assertEqualOrDiff('c = new jFormsControlString(\'rbchoixsimple\', \'Votre choix\'); 423 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 424 jForms.tForm.addControl(c); 411 425 ', $this->builder->getJsContent()); 412 426 … … 424 438 $result.='<span class="jforms-radio jforms-ctl-rbchoixsimple"><input type="radio" name="rbchoixsimple" id="'.$this->formname.'_rbchoixsimple_2" value="23"/><label for="'.$this->formname.'_rbchoixsimple_2">baz</label></span>'; 425 439 $this->assertEqualOrDiff($result, $out); 426 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'rbchoixsimple\', \'Votre choix\');427 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';428 jForms.tForm.addControl( jForms.tControl);440 $this->assertEqualOrDiff('c = new jFormsControlString(\'rbchoixsimple\', \'Votre choix\'); 441 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 442 jForms.tForm.addControl(c); 429 443 ', $this->builder->getJsContent()); 430 444 … … 436 450 $result.='<span class="jforms-radio jforms-ctl-rbchoixsimple"><input type="radio" name="rbchoixsimple" id="'.$this->formname.'_rbchoixsimple_2" value="23" checked="checked"/><label for="'.$this->formname.'_rbchoixsimple_2">baz</label></span>'; 437 451 $this->assertEqualOrDiff($result, $out); 438 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'rbchoixsimple\', \'Votre choix\');439 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';440 jForms.tForm.addControl( jForms.tControl);452 $this->assertEqualOrDiff('c = new jFormsControlString(\'rbchoixsimple\', \'Votre choix\'); 453 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 454 jForms.tForm.addControl(c); 441 455 ', $this->builder->getJsContent()); 442 456 … … 451 465 $result.='<span class="jforms-radio jforms-ctl-rbchoixsimple"><input type="radio" name="rbchoixsimple" id="'.$this->formname.'_rbchoixsimple_2" value="23" checked="checked" readonly="readonly" class=" jforms-readonly"/><label for="'.$this->formname.'_rbchoixsimple_2">baz</label></span>'; 452 466 $this->assertEqualOrDiff($result, $out); 453 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'rbchoixsimple\', \'Votre choix\');454 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';455 jForms.tForm.addControl( jForms.tControl);467 $this->assertEqualOrDiff('c = new jFormsControlString(\'rbchoixsimple\', \'Votre choix\'); 468 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 469 jForms.tForm.addControl(c); 456 470 ', $this->builder->getJsContent()); 457 471 … … 476 490 $result.='</select>'; 477 491 $this->assertEqualOrDiff($result, $out); 478 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'menulist1\', \'Votre choix\');479 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';480 jForms.tForm.addControl( jForms.tControl);492 $this->assertEqualOrDiff('c = new jFormsControlString(\'menulist1\', \'Votre choix\'); 493 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 494 jForms.tForm.addControl(c); 481 495 ', $this->builder->getJsContent()); 482 496 … … 491 505 $result.='</select>'; 492 506 $this->assertEqualOrDiff($result, $out); 493 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'menulist1\', \'Votre choix\');494 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';495 jForms.tForm.addControl( jForms.tControl);507 $this->assertEqualOrDiff('c = new jFormsControlString(\'menulist1\', \'Votre choix\'); 508 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 509 jForms.tForm.addControl(c); 496 510 ', $this->builder->getJsContent()); 497 511 … … 506 520 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 507 521 $this->assertEqualOrDiff($result, $out); 508 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'menulist1\', \'Votre choix\');509 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';510 jForms.tForm.addControl( jForms.tControl);522 $this->assertEqualOrDiff('c = new jFormsControlString(\'menulist1\', \'Votre choix\'); 523 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 524 jForms.tForm.addControl(c); 511 525 ', $this->builder->getJsContent()); 512 526 … … 524 538 $result.='</select>'; 525 539 $this->assertEqualOrDiff($result, $out); 526 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'menulist1\', \'Votre choix\');527 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';528 jForms.tForm.addControl( jForms.tControl);540 $this->assertEqualOrDiff('c = new jFormsControlString(\'menulist1\', \'Votre choix\'); 541 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 542 jForms.tForm.addControl(c); 529 543 ', $this->builder->getJsContent()); 530 544 … … 539 553 $result.='</select>'; 540 554 $this->assertEqualOrDiff($result, $out); 541 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'menulist1\', \'Votre choix\');542 jForms.tControl.required = true;543 jForms.tControl.errRequired=\'La saisie de "Votre choix" est obligatoire\';544 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';545 jForms.tForm.addControl( jForms.tControl);555 $this->assertEqualOrDiff('c = new jFormsControlString(\'menulist1\', \'Votre choix\'); 556 c.required = true; 557 c.errRequired=\'La saisie de "Votre choix" est obligatoire\'; 558 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 559 jForms.tForm.addControl(c); 546 560 ', $this->builder->getJsContent()); 547 561 … … 557 571 $result.='</select>'; 558 572 $this->assertEqualOrDiff($result, $out); 559 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'menulist1\', \'Votre choix\');560 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';561 jForms.tForm.addControl( jForms.tControl);573 $this->assertEqualOrDiff('c = new jFormsControlString(\'menulist1\', \'Votre choix\'); 574 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 575 jForms.tForm.addControl(c); 562 576 ', $this->builder->getJsContent()); 563 577 … … 573 587 $result.='</select>'; 574 588 $this->assertEqualOrDiff($result, $out); 575 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'menulist1\', \'Votre choix\');576 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';577 jForms.tForm.addControl( jForms.tControl);589 $this->assertEqualOrDiff('c = new jFormsControlString(\'menulist1\', \'Votre choix\'); 590 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 591 jForms.tForm.addControl(c); 578 592 ', $this->builder->getJsContent()); 579 593 … … 586 600 $result.='</select>'; 587 601 $this->assertEqualOrDiff($result, $out); 588 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'menulist1\', \'Votre choix\');589 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';590 jForms.tForm.addControl( jForms.tControl);602 $this->assertEqualOrDiff('c = new jFormsControlString(\'menulist1\', \'Votre choix\'); 603 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 604 jForms.tForm.addControl(c); 591 605 ', $this->builder->getJsContent()); 592 606 … … 599 613 $result.='</select>'; 600 614 $this->assertEqualOrDiff($result, $out); 601 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'menulist1\', \'Votre choix\');602 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';603 jForms.tForm.addControl( jForms.tControl);615 $this->assertEqualOrDiff('c = new jFormsControlString(\'menulist1\', \'Votre choix\'); 616 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 617 jForms.tForm.addControl(c); 604 618 ', $this->builder->getJsContent()); 605 619 … … 618 632 $result.='</select>'; 619 633 $this->assertEqualOrDiff($result, $out); 620 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'menulist1\', \'Votre choix\');621 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';622 jForms.tForm.addControl( jForms.tControl);634 $this->assertEqualOrDiff('c = new jFormsControlString(\'menulist1\', \'Votre choix\'); 635 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 636 jForms.tForm.addControl(c); 623 637 ', $this->builder->getJsContent()); 624 638 … … 730 744 $result.='</select>'; 731 745 $this->assertEqualOrDiff($result, $out); 732 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'listbox1\', \'Votre choix\');733 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';734 jForms.tForm.addControl( jForms.tControl);746 $this->assertEqualOrDiff('c = new jFormsControlString(\'listbox1\', \'Votre choix\'); 747 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 748 jForms.tForm.addControl(c); 735 749 ', $this->builder->getJsContent()); 736 750 … … 743 757 $result.='</select>'; 744 758 $this->assertEqualOrDiff($result, $out); 745 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'listbox1\', \'Votre choix\');746 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';747 jForms.tForm.addControl( jForms.tControl);759 $this->assertEqualOrDiff('c = new jFormsControlString(\'listbox1\', \'Votre choix\'); 760 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 761 jForms.tForm.addControl(c); 748 762 ', $this->builder->getJsContent()); 749 763 … … 758 772 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 759 773 $this->assertEqualOrDiff($result, $out); 760 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'listbox1\', \'Votre choix\');761 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';762 jForms.tForm.addControl( jForms.tControl);774 $this->assertEqualOrDiff('c = new jFormsControlString(\'listbox1\', \'Votre choix\'); 775 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 776 jForms.tForm.addControl(c); 763 777 ', $this->builder->getJsContent()); 764 778 … … 775 789 $result.='</select>'; 776 790 $this->assertEqualOrDiff($result, $out); 777 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'listbox1\', \'Votre choix\');778 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';779 jForms.tForm.addControl( jForms.tControl);791 $this->assertEqualOrDiff('c = new jFormsControlString(\'listbox1\', \'Votre choix\'); 792 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 793 jForms.tForm.addControl(c); 780 794 ', $this->builder->getJsContent()); 781 795 … … 800 814 $result.='</select>'; 801 815 $this->assertEqualOrDiff($result, $out); 802 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'lbchoixmultiple[]\', \'Votre choix\');803 jForms.tControl.multiple = true;804 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';805 jForms.tForm.addControl( jForms.tControl);816 $this->assertEqualOrDiff('c = new jFormsControlString(\'lbchoixmultiple[]\', \'Votre choix\'); 817 c.multiple = true; 818 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 819 jForms.tForm.addControl(c); 806 820 ', $this->builder->getJsContent()); 807 821 … … 815 829 $result.='</select>'; 816 830 $this->assertEqualOrDiff($result, $out); 817 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'lbchoixmultiple[]\', \'Votre choix\');818 jForms.tControl.multiple = true;819 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';820 jForms.tForm.addControl( jForms.tControl);831 $this->assertEqualOrDiff('c = new jFormsControlString(\'lbchoixmultiple[]\', \'Votre choix\'); 832 c.multiple = true; 833 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 834 jForms.tForm.addControl(c); 821 835 ', $this->builder->getJsContent()); 822 836 … … 839 853 $result.='</select>'; 840 854 $this->assertEqualOrDiff($result, $out); 841 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'listbox2\', \'Votre choix\');842 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';843 jForms.tForm.addControl( jForms.tControl);855 $this->assertEqualOrDiff('c = new jFormsControlString(\'listbox2\', \'Votre choix\'); 856 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 857 jForms.tForm.addControl(c); 844 858 ', $this->builder->getJsContent()); 845 859 … … 864 878 $result.='</select>'; 865 879 $this->assertEqualOrDiff($result, $out); 866 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'lbchoixmultiple2[]\', \'Votre choix\');867 jForms.tControl.multiple = true;868 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';869 jForms.tForm.addControl( jForms.tControl);880 $this->assertEqualOrDiff('c = new jFormsControlString(\'lbchoixmultiple2[]\', \'Votre choix\'); 881 c.multiple = true; 882 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 883 jForms.tForm.addControl(c); 870 884 ', $this->builder->getJsContent()); 871 885 … … 888 902 $result.='</select>'; 889 903 $this->assertEqualOrDiff($result, $out); 890 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'listboxclass\', \'Votre choix\');891 jForms.tControl.errInvalid=\'La saisie de "Votre choix" est invalide\';892 jForms.tForm.addControl( jForms.tControl);904 $this->assertEqualOrDiff('c = new jFormsControlString(\'listboxclass\', \'Votre choix\'); 905 c.errInvalid=\'La saisie de "Votre choix" est invalide\'; 906 jForms.tForm.addControl(c); 893 907 ', $this->builder->getJsContent()); 894 908 … … 907 921 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 908 922 $this->assertEqualOrDiff('<textarea name="textarea1" id="'.$this->formname.'_textarea1" rows="5" cols="40"></textarea>', $out); 909 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'textarea1\', \'Votre nom\');910 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';911 jForms.tForm.addControl( jForms.tControl);923 $this->assertEqualOrDiff('c = new jFormsControlString(\'textarea1\', \'Votre nom\'); 924 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 925 jForms.tForm.addControl(c); 912 926 ', $this->builder->getJsContent()); 913 927 … … 916 930 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 917 931 $this->assertEqualOrDiff('<textarea name="textarea1" id="'.$this->formname.'_textarea1" rows="5" cols="40">laurent</textarea>', $out); 918 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'textarea1\', \'Votre nom\');919 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';920 jForms.tForm.addControl( jForms.tControl);932 $this->assertEqualOrDiff('c = new jFormsControlString(\'textarea1\', \'Votre nom\'); 933 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 934 jForms.tForm.addControl(c); 921 935 ', $this->builder->getJsContent()); 922 936 … … 925 939 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 926 940 $this->assertEqualOrDiff('<textarea name="textarea1" id="'.$this->formname.'_textarea1" readonly="readonly" class=" jforms-readonly" rows="5" cols="40">laurent</textarea>', $out); 927 $this->assertEqualOrDiff(' jForms.tControl= new jFormsControlString(\'textarea1\', \'Votre nom\');928 jForms.tControl.errInvalid=\'La saisie de "Votre nom" est invalide\';929 jForms.tForm.addControl( jForms.tControl);941 $this->assertEqualOrDiff('c = new jFormsControlString(\'textarea1\', \'Votre nom\'); 942 c.errInvalid=\'La saisie de "Votre nom" est invalide\'; 943 jForms.tForm.addControl(c); 930 944 ', $this->builder->getJsContent()); 931 945 … … 937 951 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 938 952 $this->assertEqualOrDiff('<te
