Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » CheckboxsetField -> Value

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

Page: 1
Go to End
Author Topic: 370 Views
  • StefanDpunkt
    Avatar
    Community Member
    14 Posts

    CheckboxsetField -> Value Link to this post

    Hi,

    I have a question about " CheckboxsetField " .
    I put a CheckboxsetField as follows to:

    $ fields -> addFieldToTab ( ​​" Root.Material ", new CheckboxsetField (
      " Material ", " material " ,
      array (
        "Men " => " people " ,
        "Women " => "Women "
        " Functional" => " functional fiber "
        " Cotton " => " cotton " ,
        " QuickDryFinish " => " Quick Dry Finish"
        " IndoorDryStretch " => "Indoor Dry Stretch "
        " IndoorDryIntelligent " => "Indoor Dry Intelligent "
        " IndoorDry " => "Indoor Dry "
        " CoolMax " => " Cool Max "
        )
      )
    );

    in the template and get the following output:

    <input type="checkbox" id="Men" name="series[]" value="Men" />
    <input type="checkbox" id="Women" name="series[]" value="Women" />
    <input type="checkbox" id="Funktionsfaser" name="series[]" value="Funktionsfaser" />
    <input type="checkbox" id="Baumwolle" name="series[]" value="Baumwolle" />
    <input type="checkbox" id="Quick Dry Finish" name="series[]" value="Quick Dry Finish" />
    <input type="checkbox" id="Indoor Dry Stretch" name="series[]" value="Indoor Dry Stretch" />
    <input type="checkbox" id="Indoor Dry Intelligent" name="series[]" value="Indoor Dry Intelligent" />
    <input type="checkbox" id="Indoor Dry" name="series[]" value="Indoor Dry" />
    <input type="checkbox" id="Cool Max" name="series[]" value="Cool Max" />
    [/code ]

    But I want to have a value in the 1 , or string !

    How do I solve this ?

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