Jump to:

2011 Posts in 1436 Topics by 620 members

Form Questions

SilverStripe Forums » Form Questions » UserDefinedForms - Default Form Setup

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

Page: 1
Go to End
Author Topic: 1085 Views
  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    UserDefinedForms - Default Form Setup Link to this post

    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

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: UserDefinedForms - Default Form Setup Link to this post

    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

    1085 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.