Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main_form_alter(&$form, &$form_state, $form_id) {
- if ($form_id == 'webform_client_form_2' || $form_id == 'webform_client_form_3' || $form_id == 'webform_client_form_1') { // Пример: "webform_client_form_26"
- foreach ($form["submitted"] as $key => $value) {
- if (in_array($value["#type"], array("textfield", "webform_email", "textarea"))) {
- $form["submitted"][$key]['#attributes']["placeholder"] = t($value["#title"]);
- $form["submitted"][$key]['#attributes']["onfocus"] = "this.placeholder = ''";
- $form["submitted"][$key]['#attributes']["onblur"] = "this.placeholder =" . "'" . t($value["#title"]) . "'";
- $form["submitted"][$key]['#title_display'] = 'invisible';
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement