Jump to:

23372 Posts in 18175 Topics by 2865 members

General Questions

SilverStripe Forums » General Questions » [SOLVED] Bug? Disabled checkboxes loosing value

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: 190 Views
  • Bereusei
    Avatar
    Community Member
    94 Posts

    [SOLVED] Bug? Disabled checkboxes loosing value Link to this post

    Hey guys,

    I checked this phenomenon on serveral Silverstripe 3.1. websites, but want to be sure, that it´s really a bug from silverstripe.

    If I have a checked disabled checkbox

    <input id="Form_ItemEditForm_Categories_27" class="checkbox" name="Categories[27]" type="checkbox" value="27" checked="checked" disabled="disabled">


    in the backend/modeladmin and I save the entry, the checkbox loose the value, in other word it´s "check".

    Can anyone check this phenomenon at his own framework? I could generate this error simple with the google-webdeveloper tool by adding disabled="disabled" into <input>

  • kinglozzer
    Avatar
    Community Member
    138 Posts

    Re: [SOLVED] Bug? Disabled checkboxes loosing value Link to this post

    Hi Bereusei,

    Default browser behaviour is to not include disabled fields in POST data, so that's what's causing this. If you need to use disabled form inputs in the CMS, the best way to do it is to include some custom JavaScript to re-enable the field on form submit.

  • Bereusei
    Avatar
    Community Member
    94 Posts

    Re: [SOLVED] Bug? Disabled checkboxes loosing value Link to this post

    Thanks for the info, kinglozzer. Doesn't make any sense for me why browsers don't do this, but ok. I found a workaround for my problem. Thanks for the help.

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