Jump to:

2002 Posts in 1422 Topics by 616 members

Form Questions

SilverStripe Forums » Form Questions » Custom Field question

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

Page: 1
Go to End
Author Topic: 745 Views
  • fyodore
    Avatar
    Community Member
    2 Posts

    Custom Field question Link to this post

    I am trying to figure out what I should use to get the text that was added to a editablecheckboxoption from a submitted for to put it in the email. I can get the integer ID value, but dont know if there is a way in silverstripe to have it use that string to get me the values.

    If you look below, $this->{$stringID} gives me the integer ID's seperated by commas of the editablecheckboxoption. I am missing something and not sure what.

    if ( $field instanceof EditableCheckboxGroupField)
             {

                //get the unique id from a string stored in the field
                $stringID = $field->Name;
                
                $values = array();
                $values['Key'] = $field->Title;
                
                //load the value from this object using the unique string id from before
                $values['Value'] = $this->{$stringID};
                $set->push(
                   new ArrayData($values)
                );
    }

    745 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.