Drupal 8 - Webform hooks execute before displaying form

Here are some webform hooks which execute before rendering form. These hooks can manipulate form appearance and elements values.


function webform_webform_submission_prepare_form(WebformSubmissionInterface $webform_submission, $operation, FormStateInterface $form_state) {

}


function custom_form_alter(&$form, FormStateInterface $form_state, $form_id) { 
      $form["elements"]["full_name"]["#title"]='New Title';
} 



function custom_preprocess_webform(&$variables) {

}

 

Tags