Multiple Form Builder Edit
Created 7 years ago by edster

I need to combine 2 forms together to do an edit. How can I set the value for both?

kiltedup  —  7 years ago Best Answer

I think you do a setEntry on each form before adding to the multiple form.

$form1->setEntry(1);
$multipleForm->addForm('form1', $form1);

$form2->setEntry(1);
$multipleForm->addForm('form2', $form2);

$multipleFormBuilder->render();

I think .....

piterden  —  7 years ago

Wat?

edster  —  7 years ago

I need to allow a user edit there account email and display name, and there other profile information at the same time.

I have a multiple form builder created, and thought doing $multipleForm->render(Auth::user()->id); would put both forms in edit mode, and populate the forms with current values to be updated, but that doesn't see to be the case.

Trying to figure out how to do this.

kiltedup  —  7 years ago Best Answer

I think you do a setEntry on each form before adding to the multiple form.

$form1->setEntry(1);
$multipleForm->addForm('form1', $form1);

$form2->setEntry(1);
$multipleForm->addForm('form2', $form2);

$multipleFormBuilder->render();

I think .....

edster  —  7 years ago

You are a gentalman and a scholar sir.

I was trying to use setFormEntry which wasn't working.

thanks!

 //Add the forms
        $this->addForm('user', $userForm->setEntry(Auth::user()->id));
        $this->addForm('profile', $profileForm->setEntry(Auth::user()->id));