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.

All other Modules /

Discuss all other Modules here.

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

User Defined Forms customisation


Reply


665 Views

Avatar
kuenkuen82

Community Member, 41 Posts

26 April 2010 at 9:50pm

Edited: 26/04/2010 9:53pm

I've created a form field, which is just Yes/No

class EditableYesNoField extends EditableMultipleOptionField {
   
   static $singular_name = 'Yes/No Field';
   
   static $plural_name = 'Yes/No Fields';
   

   function getFormField() {
      $optionSet = $this->Options();
      $options = array('yes' => 'Yes', 'no' => 'No');
      
      /*if($optionSet) {
         foreach( $optionSet as $option ) {
            $options[$option->Title] = $option->Title;
         }   
      }*/
      
      return new OptionsetField($this->Name, $this->Title, $options);
   }
}

This works fine but how do I create a group of them?

Attached Files