Interesting checkbox behavior on new rows in a repeat group

blntech

Member
I have a list that has a repeat group in table format. It has a checkbox element in it. When I add a new row via the plus (+) button (via AJAX), selecting checkboxes get a little tricky. The input (the actual box) works as expected. If I click the label, it checks the corresponding input in the first row of the repeat group.

I think I found the issue. It looks like the string being used for the id of the input and for the for of the label isn't getting set properly. The name attribute is properly set.
Code:
<div class="fabrikSubElementContainer" id="cb_instructor_availability___days_2">
<div class="row-fluid">
<div class="fabrikgrid_checkbox span3"><label for="cb_instructor_availability___days_0__0_input_0" class="fabrikgrid_1 checkbox">
<input class="fabrikinput " name="cb_instructor_availability___days[2][0]" id="cb_instructor_availability___days_0__0_input_0" value="1" type="checkbox"><span>Mon</span></label>
</div>
<div class="fabrikgrid_checkbox span3"><label for="cb_instructor_availability___days_0__1_input_1" class="fabrikgrid_2 checkbox">
<input class="fabrikinput " name="cb_instructor_availability___days[2][1]" id="cb_instructor_availability___days_0__1_input_1" value="2" checked="checked" type="checkbox"><span>Tue</span></label>
</div>
...

In this snippet above,
Code:
cb_instructor_availability___days_0__0_input_0
should be something like
Code:
cb_instructor_availability___days_2__0_input_0
(note the change from 0 to 2)

As a side note, everything works as expected once the record is saved. Could you look into this or let me know what I need to do on my end to get this to work as expected? Thanks!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top