Repeating text field is not working, cannot find issues with my script.
- July 8, 2023
- 3 replies
- 664 views
I wanted field Length to populate in field Vanity top length. So I set the field to run a Javascript;
var triggerField = this.getField("Length");
var targetField = this.getField("Vanity top length");
targetField.value = triggerField.value;This would fill in the field "Length" but would not copy over to the data over to the field "Vanity top length".
So I set up a pop-up to fill in two data fields when a question was answered;
var lengthField = this.getField("Length");
var vanityLengthField = this.getField("Vanity top length");
lengthField.onFocus = function() {
var vanityLength = app.response("What is the desired vanity top length?");
if (vanityLength !== null) {
lengthField.value = vanityLength;
vanityLengthField.value = vanityLength;
}
};Once again, it would not carry the data over to the field "Vanity top length".
So I tried another function, this time putting a script for the field "Vanity top length" to equal "Length".
event.value = this.getField("Length").valueAsString;
Still no result. I have checked the spelling to ensure that was not the issue. Now I am unsure where the issue is, so I have attached screenshots to show the form fields are accurately named. 

Finally, I have attached a copy of the form itself in its current state with the aforementioned Javascript scripts found in said sections.
Where have I gone wrong?
