abdfahim
Well-known member
I show a certain custom field customA in a Widget. How can I update that custom field when someone clicks on the save button?
I created an
.
Any help please?
Code:
<xf:form action="{{ link('account/custom-save') }}" ajax="true">
<input class="input" type="text" id="customA" name="customA" value="{$user.Profile.custom_fields.customA}">
<xf:submitrow icon="save" />
</xf:form>
I created an
actionCustomSave
method to extend Account controller and tried to mimic accountSettingsSaveProcess
, but that does not work, and should not be the way to do it
Code:
public function actionCustomSave(){
$visitor = \XF::visitor();
$form = $this->formAction();
/** @var \XF\Entity\UserProfile $userProfile */
$userProfile = $visitor->getRelationOrDefault('Profile');
$this->customFieldsSaveProcess($form, 'abdforo_timeline', $userProfile);
return $this->message('Updated.');
}
Any help please?