Dan E wrote:
Hi, Has anyone found a way to get a list of boolean values from dynamically created checkboxes. I have created a bunch of checkboxes within a repeat loop like this:
<input type="checkbox" class="noborder" name="cb_array:list:int" tal:attributes="tabindex tabindex/next; checked python:test(curr_prop, 'checked', None);">
but when I access the cb_array from my python script, I only get the checked values (and I can no longer match the values up with the checkbox they came from).
any help on this would be appreciated. thanks in advance, Dan
Dan, Not really sure if this is what you want. But i've done stuff like:
<form action="showRequest"> <tal:block repeat="num python: range(10)"> <input type="checkbox" class="noborder" tal:attributes="name python:'checkBox'+ str(num);">
</tal:block>
<input type="submit" value="test me!"> </form>
</body>
When showRequest is called, it displays just the selected checkboxes like:
checkBox0 'on' checkBox2 'on' checkBox4 'on' checkBox7 'on'
hth,
David
_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )