Skip navigation
Currently Being Moderated

How to hide objects in subsequent floating forms

Mar 30, 2012 8:02 AM

Tags: #field #dynamic #forms #livecycle #form #hidden #pdf_fillable_forms #livecycle_designer #formcalc #livecycle_designer_es

Hello,

 

I have a subform which has an 'Add' button.  When user clicks on the add button, a new subform is added.  I, however, don't want to show this 'Add' button in the subsequent forms.  I want to show it in the 1st form only.  Also, the user can only add max 3 forms.  Thus, as the form number reaches 3, I want to disable/hide the 'Add' button.

 

Is there a way to do that?  Could someone show me how?

 

Thanks in advance for your help.

 
Replies
  • Currently Being Moderated
    Mar 30, 2012 10:32 AM   in reply to aenigmabella

    Hi,

     

    For the first part, the easiest way would be to take the button out of the repeating subform. Maybe place it just above the subform. Then it will not appear in other instances. You could include script in the initialize event, but this would not be the preferred route. Se how you get on with the button out of the subform and if you end up needing the script come back to us.

     

    To disable the button, you will need script in the layout:ready event of the button. This is not the most efficient, because the layout:ready event fires so often (see here http://assure.ly/nB0Bvz). If your form is not too lengthy then you mightn't notice too much of a performance hit.

     

    So, if your repeating subform is called myRepeatingSubform, the following in the layout:ready event of the button should get you close:

     

    if (_myRepeatingSubform.count >= 3) {
         this.presence = "invisible"; 
    }
    else {
         this.presence = "visible"; 
    }
    

     

    Hope that helps,

     

    Niall

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points