I have found a way to show hidden fields, but my problem is I need the script to:
1] show or add multiple sets of the hidden fields; and
2] have a remove button to remove extra fields that were accidentally added.
Basically, I am trying to display one set of multiple fields (7 total) with "add" button for the reader to add additional hidden field sets.
So my default visible set might be
text1, text2, text3, combobox4, listbox5, text6, text7
and I need several hidden sets named similarly
text1a, text2a, text3a, combobox4a, listbox5a, text6a, text7a
text1b, text2b, text3b, combobox4b, listbox5b, text6b, text7b
and so on...
I have this script working to display the first 7 fields, but I need my fields to be in groups or sets and I cannot figure out how to get it to display another set upon clicking the button.
var lst_dynamicFld = this.getField("text1");
var secondField = this.getField("text2");
var thirdField = this.getField("text3");
var fourthField = this.getField("combobox4");
var fifthField = this.getField("listbox5");
var sixthField = this.getField("text6");
var seventhField = this.getField("text7");
if (event.target.value == "No") {
lst_dynamicFld.display = display.hidden;
secondField.display = display.hidden;
thirdField.display = display.hidden;
fourthField.display = display.hidden;
fifthField.display = display.hidden;
sixthField.display = display.hidden;
seventhField.display = display.hidden;
}
else {
lst_dynamicFld.display = display.visible;
secondField.display = display.visible;
thirdField.display = display.visible;
fourthField.display = display.visible;
fifthField.display = display.visible;
sixthField.display = display.visible;
seventhField.display = display.visible;
}
Any ideas?
It is possible to do it in an AcroForm, but it will require quite a bit of scripting, plus you will not be able to automatically generate new pages to place the fields on or to push various objects to make room for the new fields.
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com