Hi,
I have some Text Field names that are changed by Javascript in certain Click Events. These renamed fields are used for navigation purposes in conjunction with xfa.form.resolveNode, and all works flawlessly until the form is saved, and re-opened.
After opening the saved form, all data entered is preserved, but the new Field names have not been preserved and resolveNode returns a null value.
The "Preserve scripting changes to form when saved" is set to "Automatically" in the Form Properties.
Any ideas/comments?
Thanks,
Ron
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Ron,
I don't think that you will get this to work. I suspect that when the form is reopened the Template DOM contains the original name of the text field and that this is used when the form is rendered.
You could test this with a temporary button with this is the click event:
console.println("Textfield name BEFORE remerge: " + TextField.name);
xfa.form.remerge();
console.println("Textfield name AFTER remerge: " + TextField.name);
You would click this AFTER your other script has changed the name of the text field. Also you will need to open the JavaScript Console (Control+J) in order to see the results.
Good luck,
Niall
Views
Replies
Total Likes
Hi Ron,
I don't think that you will get this to work. I suspect that when the form is reopened the Template DOM contains the original name of the text field and that this is used when the form is rendered.
You could test this with a temporary button with this is the click event:
console.println("Textfield name BEFORE remerge: " + TextField.name);
xfa.form.remerge();
console.println("Textfield name AFTER remerge: " + TextField.name);
You would click this AFTER your other script has changed the name of the text field. Also you will need to open the JavaScript Console (Control+J) in order to see the results.
Good luck,
Niall
Views
Replies
Total Likes
Niall, you were right, the original name is being used after the save and re-open.
I have come up with another method for getting the same result, which uses a hidden Textfield to retain the desired name value. The Textfield used for navigation is renamed each time the initialize event fires. Slightly less elegant, but it is working perfectly.
Thanks for the help!
Ron
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies