A checkbox in a loop must be selected by default
Hi all,
There are two lists of checkboxes (in a loop), and one of the checkboxes list in the loop must be selected by default. I am trying to put the value of the checkbox to true but it is yeilding bizzare results... one of them being the checkbox doesn't get deselected sometimes...
Any help would be appreciated,
Thanks,
Deepu.
[362 byte] By [
deepu_sree] at [2007-11-26 10:58:46]

# 1
Even i have the same problem. Unable to figure that out. I have these checkboxes inside a loop and the name of the checkbox is being constructed dynamically using the loopIndex as follows
<SimpleTable>
<Field Loop....>
<Field name='tempFields.checkBox_4_$(loopIndex)'>
<Display class='Checkbox' />
<Default>
<s>true</s>
</Default>
</Field>
....
</End Field Loop>
</SimpleTable>
I am incrementing loopIndex by 1 for every iteration of the loop.
If i change the checkBox field name to be static (Ex: tempFields.checkBox_4_test) the checkboxes are being checked when the page loads..
Anybody any ideas as to why it is not working when using a dynamic field name.
Thanks
SJ
# 2
Hello use the value property instead
<Field name='chk_$(index)'>
<Display class='Checkbox'>
<Property name='value' value='true'/>
</Display>
</Field>
you may use another variable to condition which indexes will be checked or unchecked.
Regards,