Copy link to clipboard
Copied
Hi,
I have a form that requires some text fields and check boxes to be hidden if a serial number that is inputted by the user contains certain numbers/ letters for example:
I would like all text fields to be shown if the initial box is empty/ if the form is cleared however, if the user inputs a serial number such as ABCD22440ABD12345 i would like the following boxes hidden: "Stuffer Box", "Waffle Plates", "Check Box13.7" and "Check Box14.5".
if ther serial number does not contain 2244 i would like "Packer Guard" and "Check Box13.3" to be hidden
if i can get that working i can probably get everything else i require to work.
Thank you
Copy link to clipboard
Copied
Here's an article on exactly this topic:
https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm
https://www.pdfscripting.com/public/How-to-write-an-If-statement.cfm
To find specific text in a string, use the "indexOf()" function.
Here's some example code. It's not complete for the conditions you've mentioned.
if(this.getField("serial").valueAsString.indexOf("2244") > -1)
{
... Hide/Show fields associated with this codition...
}
else
{
... Hide/Show fields associated with this codition...
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now