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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Trouble hiding/showing a page (hidden/visible) with javascript


Level 5


I have a script that sets a page to presence "hidden" when a field has a specific value.  The problem is, when the condition is met, the content on that page goes away, but the page stays there, blank.  It seems that this should be easy, and it works for me in other forms, but I can't make my Page4 disappear.  I have a footer on all pages and sometimes the form stretches to 5 pages, cause it's a flowed form and some fields expand with a lot of content.  I tried renaming Page4 for "Page4X" and adjusted the scripts accordingly, but it made no difference.  So I end up with a blank 5th page (the "hidden" Page4) with "Page 5 of 5" in the footer.  I just need the 5th page to disappear completely so the page counter can just say "4 of 4" on the last page that actually has content.  Any help is appreciated, thanks.

Page4.presence = "hidden";
2 Replies


Level 10

Hi there,

Could you provide a link to download the form? this issue could be caused by many possibilities


Level 5

Thanks for responding.  It turned out to be just a screen glitch.  I have a button that fills the form with fake data for testing, and for some reason the pagination doesn't function normally when filling the fields that way.  But when you type data normally into the form, it behaves as expected, so the "hidden" page actually goes away when the field value dictates, and the page numbering adjusts correctly.

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now