Skip to main content
Participating Frequently
Apr 24, 2024 7:25 PM UTC
Answered

Hide button when greater than page count

hello all,

 

    i am very new to coding in javascript, but have experience in others.  anyway basically i am trying to get a form to have a button, and when pressed it genterates template pages.  this part i have completed so far without an issue.  but what i would also like to do is once it generates those pages, hide the "Create" button so no more pages can be added, unless all additional pages are removed, then the button is visible again.  is this possible at the document level javascript by chance?

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Apr 24, 2024 7:37 PM UTC

You need to do it from the code the generates/deletes the pages.

To hide the button you can use this:

event.target.display = display.hidden;

To show it later on (from a "reset"-type button), use this:

this.getField("Create").display = display.visible;

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Apr 24, 2024 7:37 PM UTC

You need to do it from the code the generates/deletes the pages.

To hide the button you can use this:

event.target.display = display.hidden;

To show it later on (from a "reset"-type button), use this:

this.getField("Create").display = display.visible;

Translate
Participating Frequently
Apr 24, 2024 7:45 PM UTC

awesome this worked perfect. thank you so much for the help

Translate