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.

General Questions /

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

checkbox in widget not saving


Reply


893 Views

Avatar
marcink

Community Member, 89 Posts

24 April 2009 at 7:45am

hi,

i made a widget with three inputs

   static $db = array(
      "Title" => "Varchar",
      "RSSFeed" => "Text",
      "ShowRSS" => "Boolean"
   );

my getCMSField function looks like:

   function getCMSFields() {
      return new FieldSet(
         new TextField("Title", "Title"),
         new TextField("RSSFeed", "RSS Feed"),
         new CheckboxField("ShowRSS", "Show RSS Link?")
      );
   }

but after checking the checkbox and saving, the checkbox is not saved in db.
the db field is created properly, but no value is written to it.

the other fields are ok.

is it because of the widget?

thanks