drupal-alter

Validation on user registration form?

耗尽温柔 提交于 2019-12-14 03:19:08
问题 i have made module in which i am trying to add validation like if the user had entered the characters in "Phone No" text filed and same on "Mobile No". This will run when user had open the user registration form. I have made this.... <?php function form_intro_form_alter($form_id,&$form){ if($form_id == 'user_register' || $form_id == 'user_edit'){ $form['Personal Information']['profile_pno']['#validate'] = array('form_intro_pno_validate' => array()); //profile_pno is for Phone No. $form[

Drupal: adding disclaimer text above the submit button in a webform

孤街浪徒 提交于 2019-12-10 09:52:17
问题 Is there an easy-ish way to modify the webform-form-tpl.php template to show disclaimer text above the submit button in a Drupal webform? I can add text below the button, but do not know how to split up the button from the other elements to add text between them, ie: [form-elements] [disclaimer text] [submit button] Cheers! 回答1: The easiest option is probably is insert the text as a markup form item using hook_form_alter on the form. 回答2: This worked for me : $form['actions']['submit']['

Drupal: adding disclaimer text above the submit button in a webform

为君一笑 提交于 2019-12-06 01:36:50
Is there an easy-ish way to modify the webform-form-tpl.php template to show disclaimer text above the submit button in a Drupal webform? I can add text below the button, but do not know how to split up the button from the other elements to add text between them, ie: [form-elements] [disclaimer text] [submit button] Cheers! The easiest option is probably is insert the text as a markup form item using hook_form_alter on the form. This worked for me : $form['actions']['submit']['#prefix'] = 'Disclaimer...'; This doesn't really belong in the theme layer; it's content. You can add the disclaimer