Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Script to add new Objects (Textbox, Dropdown List, Checkbox)

Not applicable
Is there a way to add input objects like Textbox, Dropdown List, Checkbox, etc. with javascript?



I want to have the contents of a subform constructed on initialize.



Thanks,



Kris
2 Replies
Not applicable
The easiest method is to create all of the objects you might need and set their 'presence' property to 'hidden'. Then in JavaScript you can turn each object on (as per your own condition) by setting the proprerty to 'visible'. This will only work on the client if the form is rendered as a dynamic PDF form.

I've also heard of an advanced methodology that uses the 'proto' object to define the different objects that might be needed and then the 'use' property can be used to invoke the applicable objects as needed (see the Designer ES Scripting Reference for more info). Unfortunately I don't have any first-hand expertise on using this method.
Not applicable
In your first approach, will the pdf form file size be representive of all the objects? If i need 40 Textboxes the files will be drastically bigger? Also can I just have one of each object and do a scripted object copy, define the object, and make visible? or do i need to make each object?



Thank you for your direction.. I am going to look into the Proto Object and use property some more.



I will post my outcome.



regards,



Kris