Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Extending UserDefinedForm Module


Go to End


2 Posts   1024 Views

Avatar
mrvickiee

Community Member, 1 Post

24 January 2017 at 1:05am

Edited: 24/01/2017 11:57am

Hi all,
I am now currently trying to extend the user form module (https://github.com/silverstripe/silverstripe-userforms). I noticed there is several hooks like

$submittedForm->extend(onPopulationFormField,$field)
Now I have a class
 class CustomForm extends UserDefinedForm {
       public function onPopulationFormField($field){
           ...
       }
}

But it doesn't enter that function. I am trying to populate a hiddenfield before the form is submitted to the server. Can someone provide me some examples or instruction on how to do this please?

Thank You.
Best regards.

Avatar
dvp

Community Member, 6 Posts

5 February 2017 at 3:19am

Hi

these hooks not for subclasses, they for extensions see http://api.silverstripe.org/master/class-SilverStripe.Core.Extension.html