Changeset 396 for trunk/examples
- Timestamp:
- 09/27/07 20:01:56 (1 year ago)
- Files:
-
- trunk/examples/example_element_string.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/examples/example_element_string.php
r268 r396 2 2 /** 3 3 * Example for the Date element 4 * 4 * 5 5 * $Id$ 6 6 * … … 19 19 $exampleGen->displayHead( 'Example' ); 20 20 21 21 22 22 // EXAMPLE START ------------------------------------------------------ 23 23 … … 26 26 */ 27 27 require_once $neededFiles['patForms']; 28 28 29 29 /** 30 30 * patErrorManager class … … 32 32 require_once $neededFiles['patErrorManager']; 33 33 34 34 35 35 // element definitions for this example 36 36 $elementsDefinition = array( … … 44 44 'title' => 'Username', 45 45 'description' => 'Please enter your username here.', 46 'minlength' => 2, 47 'maxlength' => 10 46 48 ), 47 49 ), … … 93 95 'description' => 'Please enter your secret here.', 94 96 // This forces the password to be sent to the browser when displaying the form 95 // CAUTION: This may pose a security-risk as the password can be read in the 97 // CAUTION: This may pose a security-risk as the password can be read in the 96 98 // HTML-code. 97 99 'resendpasswd' => 'yes' … … 99 101 ), 100 102 ); 101 103 102 104 // create the form 103 105 $form =& patForms::createForm( $elementsDefinition, array( 'name' => 'myForm' ) ); 104 106 105 107 // create the needed renderer 106 108 $renderer =& patForms::createRenderer( "Array" ); 107 109 108 110 // set the renderer 109 111 $form->setRenderer( $renderer ); 110 112 111 113 // use auto-validation 112 114 $form->setAutoValidate( 'save' ); … … 114 116 // serialize the elements 115 117 $elements = $form->renderForm(); 116 117 118 119 118 120 // ERROR DISPLAY ------------------------------------------------------ 119 121 // ask the form if it has been submitted and display errors. For
