Adding checkboxes with same name but different export values using JS
Please can someone help me.
I'm trying to add several checkboxes to a page.
All the checkboxes should have the same name but have different export values.
Is this possible as so far I've not succeeded.
Here's the code so far...
thisField = this.getField('dupethis');
var cRtn = app.response("How many checkboxes would you like?");
var prevRect = thisField.rect;
var prevName = thisField.name;
//this.removeField(theFieldName);
var offset = 30;
for (var i = 0; i < cRtn; i++) {
var newRect = [prevRect[0]+offset, prevRect[1], prevRect[2]+offset, prevRect[3]]
var fn = this.addField({
cName: "p1f1" + "_CB",
cFieldType: "checkbox",
nPageNum: 0,
oCoords: newRect
});
offset = offset + 30;
var thisExpVal = "sammy" + offset;
fn.exportValues=[thisExpVal];
}
I'm having problems because I'm trying to give all the checkboxes the same name.
I need this so the checkboxes then behave like radio buttons, i.e. only one option can be selected, however with set up the user can uncheck all of the checkboxes.
Is this possible?
Thanks in advance.
