auto update field content based on state of other fields?
i"m trying auto populate field "check" or other indicator/symbol based on user has selected in other fields (which radio buttons or other check boxes). ex: user clicks radio button part time work , on page in form several check boxes "activated" show check next various part time benefits receive.
my form imported excel , works in excel file using basic excel formulas. see can calculations using mathmatical formulas in pdf form, see nothing relating field states when fields text based. can done or require java programming? help.
it requires bit of javascript programming. easiest set hidden text field , create custom calculate script work. example, following code gets value of radio button group (two buttons, possible values: yes, no) , sets 2 separate check boxes (export values: yes):
// custom calculate script hidden text field
(function () {
// value of radio button group (will either yes or no)
var v1 = getfield("radio1").value;
// references check boxes
var f2 = getfield("check1");
var f3 = getfield("check2");
// set check boxes, depending on value of radio button
if (v1 === "yes") {
f2.value = "yes";
f3.value = "yes";
} else {
f2.value = "off";
f3.value = "off";
}
})();
this isn't efficient code, intended clear.
More discussions in PDF Forms
adobe
Comments
Post a Comment