Creating a PDF Form with fields that auto populate
I have an issue that I am unable to resolve using previous posts. I am attempting to create PDF forms that are loaded with data that was preciously selected and stored in a database. Once the page is loaded, it is no longer interactive for the person and it is viewable as a read only. Although it is no longer interactive for the person, there are some additional fields that I would like to auto-populate on the form based on the data that is being loaded from the database. I have tried calculation scripts, validation scripts, action custom scripts, etc. These all work if the form is interactive and the selection is made on the form itself and not created as read only. I think the problem is that these pre-loaded fields from the database do not perform an "action" on the form after it is loaded and therefore these scripts don't execute. Is there a way to apply a script that will execute as the form is loading? Or is there another way that this can be done?
Here is a calculation script that I tried. The appl_withholding_status_S is a pre-selected field and loaded from a database. This calculation script is applied to the field that should auto-populate based on the data in appl_withholding_status_S field.
var v = this.getField("appl_withholding_status_S").valueAsString;
if (v=="S"){
event.value = 6000
} else event.value = "";
Here is another calculation script that I tried. This was created as a Mouse Up Run Java Script on a check box where the value is also pulled from a database. The result of the check box should prefill another field.
if (event.target.value!="Off")
this.getField("Calc_Ex_Single").value=1;
I have attempted countless other scripts and methods and none of them work. The scripts work if I interact with the form but not if the fields are loaded from a database. I am rAny suggestions?
