This content has been marked as final. Show 9 replies
hi many thanks, not sure how you mean?
do i have to use current row? or just the query group ?
Use the query group column: #ShowNames.Team# so each group of checkboxes will have the same name.
One caveat.. the "Team" column looks like a string value. Using free form string values to name form fields can be problematic. Its safer to use a numeric value like (5) instead of a team name like ("San Francisco 49'ers"). If your table has a numeric "TeamID" column then use "TeamID" to name the form fields instead of "Team" name.
ok i understand now i have done that which works but now on my action page how do i loop through each tick box to input into my database
i have attached the code i had before which nolonger works
I'm not sure I understand the usage of the startRow and dispRows variables on the action page. Are you trying to process all of the fields on your form page or only some of them? Can you briefly describe what your action page should be doing?
ok all i want to do is set the check box value to '1' if is checked, then input that value into my database where it matches the playerID
say i checked 3 boxes next to John, Paul, Jeff
i need to then put a value of '1' into my database for each of these names
Ok. Its a bit confusing because the field names in your first example don't all correspond to your action page code. Is form.SMSYes_#currRow# the same as
<input type="checkbox" name="myCheckbox_#ShowNames.CurrentRow#" value="checkbox">
sorry yes it is but i changed it as you told me to
<input type="checkbox" name="#ShowNames.Team#" value="checkbox">
so i need to now loop through each of these and input them
No. I meant replace the field suffix. So using your original example ..
<input type="checkbox" name="myCheckbox _#ShowNames.CurrentRow#" value="checkbox">
Instead of CurrentRow, you would use the query group column as the suffix.
<input type="checkbox" name="myCheckbox_ #ShowNames.Team#" value="checkbox">
But like I said, using a string value like "Team" can be problematic. Its much better to use a number value like "TeamID" if your table has one. Or you could just use a counter like the attached example.