Jump to:

5541 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » When using DropdownField the output is hidden with inline CSS

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

Page: 1
Go to End
Author Topic: 340 Views
  • kharmer
    Community Member
    8 Posts

    When using DropdownField the output is hidden with inline CSS Link to this post

    Hi All,

    I'm pretty new to Silverstripe so excuse me if this is obvious!

    I am creating a custom view/form and from my custom controller I have the following:

    $fields = new FieldSet(
    new TextField('FirstName', '<span>*</span> First name'),
    new TextField('Surname', '<span>*</span> Surname'),
    new EmailField('Email', '<span>*</span> Email'),
    new ConfirmedPasswordField('Password', '<span>*</span> Password'),
    new TextField('Agentid', '<span>*</span> SAP ID'),
    new DropdownField('AgentDistributor', '<span>*</span> Distributor', array('' => '-- Select relevant distributor','Distributor 1 --' => 'Distributor 1','Distributor 2' => 'Distributor 2'))

    In the browser, all is fine for the each field except for the DropdownField. When the page is rendered the dropdown field is hidden from view. Using firebug I noticed that it has some inline CSS in the DIV that wraps around it (style="display: none; width: 0px;").

    I have inherited this project on behalf of a client from another developer. The version we are running is 2.4.

    Am I missing something or could it be that the previous devs added this for whatever reason?

    Any pointers much welcomed.

    Best regards,

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.