<td colspan="2"> <input type="text" name="bl_reason" id="bl_reason" size="30"> </td> </tr> </table> </div> <div id="icons-options"> <img src="images/window-close.png" border="0" class="click" style="position: absolute; top: 5px; left: 230px;" id="icons-close"> <div style="height: 100px; width: 210px; overflow: auto;"> <?php foreach ($icons as $icon) { ?> <div style="padding-bottom: 3px;"> <?php echo Checkbox('icons[]', 'checkbox', $icon['icon_id'], ''); echo " " . $icon['icon_html']; ?> </div> <?php } ?> </div> </div> <!-- top: 150px; left: 530px --> <div id="submit-info" style="position: absolute; top: 14em; left: 50em; font-size: 8pt; font-weight: normal"> <b>Submit Info</b><br /> <?php echo $gallery['email']; ?>
* ->class('someclass'), * for a placeholder: ->placeholder('Some text'). If the attribute doesn't * take a value just omit it, so : ->required() * * In addition to HTML attributes, each element takes meta-data such as the * submitted value. All meta-data is set in exactly the same way but is prefixed * with a single underscore. For example, you can set the form's show_submitted * flag with ->_show_submitted(true), or force an initial check on a specific * item in a radioset using ->_value('name') -- in this case you are setting up * the element to appear as if that value was already submitted to it. * * This is done to make form specification as terse and fluent as possible * -- yet still giving control where needed. * **/ $contact_form = Form('contact', './')->setRenderer($r)->onSuccess('MySuccessHandler')->novalidate()->add(Fieldset('About you...', 'about')->class('about')->add(Checkbox('control', '>Collect Personal Details', 'ok')->_ignore_parent_fields('disabled,readonly,required'))->add(Input('salutation', 'Title', 'Your title please')->autofocus()->datalist($salutations)->required())->add(Input('name', 'Your Name', 'Your name please')->autocomplete('off')->required()->validator('myNameValidator'))->add(Email('email', 'Your Email', 'Your email address')->required()->autocomplete('off'))->add(URL('url', 'Website', 'Your URL here (optional)'))->add(Hidden('secret', '123'))->add(Password('pass', 'Your Password', 'Enter a password of 10 characters or more')->required()->minlength(10, '10+ chars. please'))->add(Password('oth', 'Repeat Password', 'Enter password again')->required()->minlength(10, '10+ chars. please')->matches('pass', 'This must match what you typed in the "Your Password" field.'))->add(Tel('tel', 'Phone', 'A contact number please')->pattern('/^[\\s]*[\\+]?[0-9][-0-9]*[\\s-0-9]*[\\s]*$/', 'Enter a valid phone number. This can start with an international code like +44 if needed.'))->add(Input('human', 'Are you human?', 'No bots please')->pattern('/^yes|yep|yeah|sure am|indeed$/i', 'Some form of affirmation is needed.')->required())->add(YesNo('alive', 'Were you alive when you celebrated your last birthday?', 'Babies excluded.', 'Just yes or no please.')->required())->add(Integer('age', 'How old are you?')->value(5)->min(2)->max(10)))->add(Fieldset('Your message...')->add(TextArea('msg', 'Message', 'Your message to us')->required()->pattern('/^[^0-9]*$/', 'No numbers please!')->whitelist('great,good,fantastic,amazing')))->add(Fieldset('Legal stuff...')->add(Radios('agreement', '>Do you agree to our terms?', $conditions)->required('* Please select one of the options')->validator('myConditionValidator'))->add(Checkboxes('options', 'Additional Options...', $checkboxes)->required()->value('spam_me'))->add(MSelect('depts', 'Forward to which departments?', $departments)->required('Please choose at least one department')->value('complaints-2 , complaints-3 , sales-0')))->add(Submit('Send'))->process(); /** ==================== Custom formatters follow ==================== * * These all override, or append to, some aspect of the renderer's output * and should allow you fine enough control over your form output not to * have to resort to hand-crafted HTML. * * They are all enabled by setting values on the renderer. * Thay are also totally option. In fact, the default output of the renderer * should be fine in most cases so you can probably delete all the code in * this part of the file. **/ /** * Controls the output that goes at the head of the form when there are any * invalid elements. Use this only if the renderer's default markup isn't * what you need.