edster - 1 year ago

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

Answer

kiltedup - 1 year ago

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 - 1 year ago

Wat?

edster - 1 year 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 - 1 year ago

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 - 1 year 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));