1.20.x form_test.module | form_test_placeholder_test($form, &$form_state) |
Builds a form to test the placeholder attribute.
File
- modules/
simpletest/ tests/ form_test.module, line 1504 - Helper module for the form API tests.
Code
function form_test_placeholder_test($form, &$form_state) {
foreach (array('textfield', 'textarea', 'url', 'search', 'password', 'tel', 'number') as $type) {
$form[$type] = array(
'#type' => $type,
'#title' => $type,
'#placeholder' => 'placeholder-text',
);
}
return $form;
}