Here is the buildForm function for creating an AJAX form. public function buildForm(array $form, FormStateInterface $form_state) { $form = []; $form['email'] = [ '#type' => 'textfield', '#attributes' => ['placeholder'=>'Enter your Email ID'], '#description' => 'Submit your email address to recieve updates', '#size' => 100, '#maxlength' => 150, '#required' => TRUE, ]; $form['submit_button'] = [ '#type' => 'submit', '#name' => 'submit-email', '#value' => '>', '#ajax' => [ 'callback' => '::processEmail', 'wrapper' => 'thanks-message', 'effect' => 'fade', 'event' =...
Comments
Post a Comment