Hi there. I got a dozen textfields and datetimefields in a pdf fillable form create by livecycle designer. All textfields and datetimefields have the default values. I got some javascripts to toggle checkbox to the effect that when checkbox is checked, the default value in the textfield will be cleared and let user to enter the new value; and when it is unchecked, the default value will be restored in the textfield.
if (this.rawValue == "1") {
oTargetField = this.resolveNode("DateTimeField1");
oTargetField.access = "open";
oTargetField = this.resolveNode("TextField1");
oTargetField.access = "open";
this.resolveNode("TextField1").rawValue = null;
this.resolveNode("DateTimeField1").rawValue = '';
xfa.host.setFocus("TextField1");
}
if (this.rawValue == "0") {
this.resolveNode("TextField1").rawValue = defaultValue; }
But, the script does not work when I uncheck the checkbox. Any advice, please?