Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By amojarrad on
Hi I am new(ish) to Drupal 8. I want to add a field to contact form and it is not working. The same code works when i add a field to a form generated with the form api.
My code is:
if($form_id == "contact-message-tell-us-form") {
drupal_set_message ("inside contact-message-tell-us-form");
$form['fun_text'] = array(
'#markup' => 'This should show but it does not',
'#weight' => -10
);
}
this is inside hook_form_alter
Thanks
Amir
Comments
=-=
module development and code questions are better suited in the 'module development and code questions' forum Please edit your post and move it. Thank you.
Also of note, when submitting code to drupal.org please use code tags. Doing so aids with readability and insures none of your submission is stripped.