Multiple forms on one page I try to input several forms into one page via Controller. With code which is
under, I see those forms but after submit one of them, nothing happens. Any of data is send to database. Has anyone idea how to fix this?
&lt;?php

namespace Drupal\Core\Entity\ContentEntityForm;
namespace Drupal\student\Controller;
use Drupal\node\Entity\Node;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Controller\ControllerBase;
use Drupal\node\NodeInterface;
use Drupal\node\Entity;
use Drupal\node\NodeForm;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Url;
use Drupal\Core\Link;
use Drupal\Core\Routing;
use Drupal\Core\Entity\ContentEntityForm;

class SFormController extends ControllerBase {

  function new_form() { 
    
    $build = [];
  
    foreach ($stud as $id =&gt; $name) {
      
      $node = \Drupal\node\Entity\Node::create(['type' =&gt; 'student']);
      $form = \Drupal::service('entity.form_builder')-&gt;getForm($node, 'student_form');
      
      $build[] = $form;
    }   
    return $build;
  }
}

?&gt;
You need to make the form ID dynamic, so that it is different for each instance on the page. As you're extending EntityForm, you'll have to extend it, then register your form on the node class, and finally call your form class.

Extend the entity form:
class MyEntityForm extends EntityForm {
  public function getFormId() {
    // The dynamic form ID allows for the form to be
    // reused on a page.
    return parent::getFormId() . '-' . $this-&gt;getEntity()-&gt;id();
  }
}




Register your form class on the node entity type:
/**
 * Implements hook_entity_type_alter().
 */
function HOOK_entity_type_alter(array &amp;$entity_types) {
  $node = &amp;$entity_types['node'];
  $node-&gt;setFormClass('my_form_type', 'Drupal\[MODULE]\Form\MyEntityForm');
}


Call your form from your controller:
  $form = \Drupal::service('entity.form_builder')-&gt;getForm($node, 'my_form_type');