Hello,
I have a 4 page form that I need to be able to hide 3 of the 4 pages until a selection is made from a dropdown box on the first page. So, for example, I have pages labeled:
Page 1
Page 2
Page 3
Page 4
I have a dropdown box that has
Page 2
Page 3
Page 4
for options and if no selection is made only Page 1 will be visible. If the selection is Page 2, I would like all pages except page 2 to be hidden and only show page 2, not have 4 pages show and only Page 2's fields show.
Does anyone know how to accomplish this?
Thank you in advance for any insight!
Solved! Go to Solution.
Views
Replies
Total Likes
The only caveat to enabling your requirement is that the first page of the form cannot be removed. If you set page 1 to "hidden" the objects on the page will be hidden but the page itself will remain in the rendered form as a blank page.
The attached demonstrates a form with page 0-4 (5 pages). A drop-down is on page 0 and it controls the rendering of pages 1-4.
Steve
Views
Replies
Total Likes
It sounds like your best option would be to make pages 2, 3 and 4 hidden from the start and then, based on your dropdown selection (or checkbox selection; checkboxes would probably be easier to work with) you would set the presence to the proper page to "visible". Here's a code sample to help:
if (this.rawValue == "Page 2") {
form1.page2.presence = "visible";
}
This script is javascript and as such, you'll need to make sure you have javascript selected as your scripting language.
The only caveat to enabling your requirement is that the first page of the form cannot be removed. If you set page 1 to "hidden" the objects on the page will be hidden but the page itself will remain in the rendered form as a blank page.
The attached demonstrates a form with page 0-4 (5 pages). A drop-down is on page 0 and it controls the rendering of pages 1-4.
Steve
Views
Replies
Total Likes
That worked great! Thank you. One other question...do you know how to add the attribute to a button?
Views
Replies
Total Likes
Good. Which attribute do you want to add?
Views
Replies
Total Likes
The visible/hidden pages. So, for example, if there is a button on the form, clicking it will hide/unhide x page(s).
I also added xfa.host.currentPage = 1; so that it would directly navigate to the page of the selection, but then the selection is deleted from the dropdown, any way to have it go to the page and keep the selection in the dropdown?
Thanks again for the help!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies