This is a migrated thread and some comments may be shown as answers.

checkboxes in grid have no values on submit

2 Answers 216 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 10 Dec 2011, 07:49 PM
I have a form with an embedded grid that has a template in one column:

<input type="checkbox" name="roles" id="roles" value="" + roleid + "" checked="checked">

The display works fine.

When I submit the form, however, "roles" has no values. I checked to ensure "roleid" is actually populated with data - it is. The form field "roles" is indeed being passed from within the grid - it just has no values. I can populate a form field outside of the grid with the roleid and the value posts. So the problem is clearly related to the grid.

Anyone have an idea why the values are not being sent?

2 Answers, 1 is accepted

Sort by
0
Brandon
Top achievements
Rank 1
answered on 13 Dec 2011, 08:15 PM
I'm not sure if this is the best way to do it, but when creating the check boxes i gave each one a unique class.  Then in the parameter map I went through each checkbox, and manually assigned a value to the "data" if the checkbox was checked or not.

0
Chris
Top achievements
Rank 1
answered on 13 Dec 2011, 09:29 PM
Thanks for the input. It was a dumb error on my part - I used double quotes when concatenating my strings.

<input type="checkbox" name="roles" id="roles" value="" + roleid + "" checked="checked"

should have been:

<input type="checkbox" name="roles" id="roles" value="' + roleid + '" checked="checked"
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Brandon
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Share this question
or