Yup I just found $Fields.dataFieldByName(Email)

👍 (1)

Hi all, within a form template how can I call a single form field? instead of looping through the fields

@firesphere I dunno what it was, but dropping the database and rebuilding it worked

Yeah it's just in page controller as this is meant to just be a single page site where people can log in and confirm their details

@firesphere Hmm it looks like it's not. So in my form creation I have: $actions = new FieldList( FormAction::create('submitForm', 'Submit') );

and then: public function submitForm($data, $form){ $member = ExtendedMember::currentUser(); $form->saveInto($member); $member->write(); $form->sessionMessage("Details updated",'good'); return $this->redirectBack(); } (edited)

@frontiex Nah I just extended member. I have it working now, I was just not loading in the data correctly in the form template. But for some reason it's still not saving it correctly on the submisison

Any help would be greatly appreciated. Thanks

I also can't save the form results to the user like I would expect inside the submit method: private function submitForm($data, $form){ $member = ExtendedMember::currentUser(); $form->saveInto($member); $member->write(); $form->sessionMessage('Your details have been updated','good'); return $this->redirectBack(); }

Hi all, So I'm having trouble creating a form that will allow users to update their own details. I have extended the member class and added a few extra fields relevant to the site. Then I've created a page that only logged in users can access which has a form that has all the same fields as the member field. If when I build the form I do: $member = ExtendedMember::currentUser(); $form->loadDataFrom($member); return $form; It doesn't work. Any ideas why? (edited)