[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <html> 2 <head> 3 <title>Form Test</title> 4 <style> 5 6 body, table, tr, th, td { 7 font-family: Verdana; 8 font-size: 9pt; 9 background-color: aliceblue; 10 } 11 12 div.Savant-Form { 13 margin: 8px; 14 } 15 16 fieldset.Savant-Form { 17 margin: 8px; 18 border-top: 1px solid silver; 19 border-left: 1px solid silver; 20 border-bottom: 1px solid gray; 21 border-right: 1px solid gray; 22 padding: 4px; 23 } 24 25 legend.Savant-Form{ 26 padding: 2px 4px; 27 color: #036; 28 font-weight: bold; 29 font-size: 120%; 30 } 31 32 table.Savant-Form { 33 border-spacing: 0px; 34 margin: 0px; 35 spacing: 0px; 36 padding: 0px; 37 } 38 39 tr.Savant-Form { 40 } 41 42 th.Savant-Form { 43 padding: 4px; 44 spacing: 0px; 45 border: 0px; 46 text-align: right; 47 vertical-align: top; 48 } 49 50 td.Savant-Form { 51 padding: 4px; 52 spacing: 0px; 53 border: 0px; 54 text-align: left; 55 vertical-align: top; 56 } 57 58 label.Savant-Form { 59 font-weight: bold; 60 } 61 62 input[type="text"] { 63 font-family: monospace; 64 font-size: 9pt; 65 } 66 67 textarea { 68 font-family: monospace; 69 font-size: 9pt; 70 } 71 72 </style> 73 </head> 74 <body> 75 <?php 76 77 // start a form and set a property 78 $this->form('start'); 79 $this->form('set', 'class', 'Savant-Form'); 80 81 // add a hidden value before the layout 82 $this->form('hidden', 'hideme', 'hidden & valued'); 83 84 // NEW BLOCK 85 $this->form('block', 'start', "First Section", 'row'); 86 87 // text field 88 $this->form('text', 'mytext', $this->mytext, 'Enter some text here:', null); 89 90 // messages for the text field 91 $this->form('note', null, null, $this->valid['mytext'], 92 array('required' => 'This field is required.', 'maxlen' => 'No more than 5 letters.', 'no_digits' => 'No digits allowed.')); 93 94 $this->form('block', 'split'); 95 96 // checkbox with default value (array(checked, not-checked)) 97 $this->form('checkbox', 'xbox', $this->xbox, 'Check this:', array(1,0), 'style="text-align: center;"'); 98 99 // single select 100 $this->form('select', 'picker', $this->picker, 'Pick one:', $this->opts); 101 102 // END THE BLOCK and put in some custom stuff. 103 $this->form('block', 'end'); 104 ?> 105 106 <!-- the "clear: both;" is very important when you have floating elements --> 107 <h1 style="clear: both; background-color: silver; border: 1px solid black; margin: 4px; padding: 4px;">Custom HTML Between Fieldset Blocks</h1> 108 109 <?php 110 // NEW BLOCK 111 $this->form('block', 'start', "Second Section", 'col'); 112 113 // multi-select with note 114 $this->form('group', 'start', 'Pick many:'); 115 $this->form('select', 'picker2[]', $this->picker2, 'Pick many:', $this->opts, 'multiple="multiple"'); 116 $this->form('note', "<br />Pick as many as you like; use the Ctrl key on Windows, or the Cmd key on Macintosh."); 117 $this->form('group', 'end'); 118 119 // radio buttons 120 $this->form('radio', 'chooser', $this->chooser, 'Choose one:', $this->opts); 121 122 // NEW BLOCK 123 $this->form('block', 'start', null, 'row'); 124 125 // text area 126 $this->form('textarea', 'myarea', $this->myarea, 'Long text:', array('rows'=>12,'cols'=>40)); 127 128 // NEW BLOCK (clears floats) 129 $this->form('block', 'start', null, 'row', null, 'both'); 130 $this->form('submit', 'op', 'Save'); 131 $this->form('reset', 'op', 'Reset'); 132 $this->form('button', '', 'Click Me!', null, array('onClick' => 'return alert("hello!")')); 133 134 135 // end the form 136 $this->form('end'); 137 ?> 138 139 </body> 140 </html>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |