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.

Form Questions /

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

UserDefinedForms - Default Form Setup


Go to End


2 Posts   1728 Views

Avatar
Double-A-Ron

Community Member, 607 Posts

9 October 2009 at 11:12am

Hi all,

I'm extending UserDefinedForm to create a page type with the following additional behavior:

1. A common default form is setup for the user on page creation. E.G. Firstname, Surname, Email, Address are all setup by default.
2. A new tab to load PDF documents pertaining to the page in PDF format.
3. The OnCompletion page displays links to download the PDF documents in 2.

Basically, people have to enter personal info to download the PDF documents.

I should be able to work out the last two. But does anyone have any starter for create a default form when this new page type is created?

Chur
Aaron

Avatar
Double-A-Ron

Community Member, 607 Posts

14 October 2009 at 4:11pm

Anyone?

When you add a field to a UserDefinedForms, it automatically adds a record to the DB for a new field, although all the options are NULL. (userforms/code/editor/FieldEditor.php function "addfield"). This part is easy.

Then when you save a new form in the CMS, it updates the above record with a who bunch of default settings. These settings must be coming from somewhere.

Basically I need to run this default process manually for each field I need as soon as a user creates a page of this type.

Cheers
Aaron