Jump to:

2012 Posts in 1438 Topics by 621 members

Form Questions

SilverStripe Forums » Form Questions » How to loop through a CheckboxsetField?

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

Page: 1
Go to End
Author Topic: 533 Views
  • _Vince
    Avatar
    Community Member
    161 Posts

    How to loop through a CheckboxsetField? Link to this post

    I have a table of skills and a table of EmployeeSkills. to display this on a form, I use a CheckboxsetField and it works great.

    But now, I am being asked to add a dropdown list of skill levels for each Employee Skill.

    So what I want to do is have
    a checkbox and a dropdown list next to it
    a checkbox and a dropdown list next to it
    a checkbox and a dropdown list next to it

    and so on.

    Is there any way to say something like

    <% control MyCheckboxSetField %>
       <div class="field checkbox">
          <label class="left" for="{$FormName}_SkillName">Skill Name</label>
             <div class="middleColumn">
                $dataFieldByName(Current Iteration Of The Checkbox List)
             </div>
          </div>
       <div class="field list">
          <label class="left" for="{$FormName}_SkillName">Skill level</label>
    .
    .
    .
          </div>

    <% end_control %>

  • _Vince
    Avatar
    Community Member
    161 Posts

    Re: How to loop through a CheckboxsetField? Link to this post

    Anybody? All I want is to be able to loop through the CheckboxsetField so I can lay them out in different ways.

  • martimiz
    Avatar
    Forum Moderator
    1091 Posts

    Re: How to loop through a CheckboxsetField? Link to this post

    As I read this, you want to create some sort of nested CheckBoxSetField where the 'inner' options are represented by dropdown fields. If that's what you mean, I don't think it can be done.

    Can you give us an idea of the relations involved?

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