I am trying to copy a set of fields to another identical set using a checkbox in LiveCycle Designer. I have pasted my script below. Can anyone help me as I am not sure what I am missing.
Javascript beginner
Thanks
// check the state of the button
if(this.getField('copyfields').value == '1') {
// checked
// copy requestor information
// get each requestor field object's value and set the sponsor field's value
this.getField('rname').value = this.getField('sname').value;
this.getField('rphone').value = this.getField('sphone').value;
this.getField('rdept').value = this.getField('sdept').value;
this.getField('remail').value = this.getField('semail').value;
this.getField('rtitle').value = this.getField('stitle').value;
// lock fields
// set each sponsor field's read only property to locked - true
this.getField('sname').readonly = true;
this.getField('sphone').readonly = true;
this.getField('sdept').readonly = true;
this.getField('semail').readonly = true;
this.getField('stitle').readonly = true;
} else {
// unchecked
// unlock fields
// set each sponsor field's readonly property to unlocked - false
this.getField('sname').readonly = false;
this.getField('sphone').readonly = false;
this.getField('sdept').readonly = false;
this.getField('semail').readonly = false;
this.getField('stitle').readonly = false;
}
the JavaScript you used is for AcroForms and not supported by LiveCycle Designer.
To get it work in Designer you need to change the script.
radzmar
• LoveCycle Blog
Documents you need:
• LiveCycle Designer ES2 Docs