Using checkboxTag Form functions

7 views
Skip to first unread message

Jon Hartmann

unread,
Jun 1, 2009, 1:12:47 PM6/1/09
to ColdFusion on Wheels
I'd mentioned this in another post, but I think the question of
associations too over. It seems as though using the checkbox helper
functions to generate tags wont work when dealing with multiple
values, such as a list. Say for instance, I have 3 options for a
record (three possible associations to other records) and I want my
users to be able to select 0 to 3 options with checkboxes, and then
have the results as a list when processing. The problem that I'm
having is that the helper functions always seem to base the ID value
of their inputs based on the name value, and in this case the name
needs to be the same, but they need to have different IDs. Is this
just a limitation of the system, or is there a more "wheels" like way
to deal with this situation?

wfisk

unread,
Jun 1, 2009, 5:16:11 PM6/1/09
to ColdFusion on Wheels
You could use the function checkBoxTag instead of checkBox,
and pass the arguments name, value and id. Pass the name exactly as
cfwheels expects it in "objectname[property]" format. Set the value
and id to what you want.

With the name being the same you should get the "checked" items back
as a list.


Reply all
Reply to author
Forward
0 new messages