Expand my Community achievements bar.

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

Avatar

Level 5

Hello,

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

Avatar

Level 10

Hi there,

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

Avatar

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.