I am pretty new to PDF forms and all things java and am still having a difficult time figuring out what I can and cannot accomplish in these forms...so I thought I would just ask the question this time...
What I would like to do is have a the value entered in one field (FromDept) be auto-populated into another field (ToDept) but then I would still like the ToDept field to be able to be changed if the user needs to change it.
For this form, these field are very often the same but sometimes they do need to be different - usually the user will just skip this field if it is not changing but we would really prefer the form look complete (though I don't want to force completion of this field - thus my question).
I thought it would be some sort of Custom Validation script but have not found anything that fits my needs in the forums after a lot of searching.
Is this something that can be done with relative ease or is it more complicated than I need to get for something that is just on a "nice to have" list?
Any help would be greatly appreciated.
The custom validate script for the FromDept field could be as simple as:
getField("ToDept").value = event.value;
This will set the ToDept field value whenever the FromDept value changes.
You could also set it up so that the ToDept value only gets set if it is blank:
var f = getField("ToDept");
if (!f.valueAsString) f.value = event.value;
This way, an existing entry in ToDept won't get overwritten if the user goes back and changes the FromDept value.
Europe, Middle East and Africa