Jump to:

23451 Posts in 18899 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Form Renderwith doesn't show form or any styling

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 310 Views
  • Fraser
    Community Member
    46 Posts

    Form Renderwith doesn't show form or any styling Link to this post

    I am trying to render a form with template with the following:

    function FacebookForm($fbFields) {

          $actions = new FieldSet(
             new FormAction('doFaceBookForm', 'Register')

          $memberfields = singleton('XEUser')->getMemberFormFields();

          $fields = new FieldSet();
          $reqFields = array();
          foreach($fbFields as $key => $value){
                case 'Gender':
                   $reqFields[] = 'Gender';
                case 'DateOfBirth':
                   $reqFields[] = 'DateOfBirth';
          $validator = new RequiredFields($reqFields);

          $form = new Form($this, 'FaceBookForm', $fields, $actions,$validator);
          return $form->renderWith(array('FacebookController','Page'));
          //return $form;


    When I just

    return $form

    my form appears but in the default contentController.ss so I created a new template and added

    return $form->renderWith(array('FacebookController','Page'));

    . When I do this, I get everything that should be in the page but with no styles being applied at all and the form doesn't even appear. Here is my FacebookController template:

    <div id="left">
       <h2>Thankyou for signing up with your Facebook account</h2>
       <p>The following details could not be obtained from your Facebook account, please enter them now.</p>

    <div id="right">


    anyone shed any light on this?

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.