Expand my Community achievements bar.

SOLVED

Subform Instance Controls: Add Button

Avatar

Former Community Member

Hello,

I have a subform that i want to continue repeating when the user clicks on the add button. I would like the minimum to be 0 and when the user clicks on the button it will bring up the first occurrence. The problem is that it is not allowing me to have a minimum of 0, only 1. if i change it to 0 then the subform does not appear when clicking the add button.

Also, i keep getting an error message when clicking the add button. it says "Date of birth: the birth date must be entered". the message appears about 5 times. I have made the date of birth field in the subform 'optional' as it was previously mandatory, and i have confirmed that there is no other script causing the problem, so im not sure why it isnt working.

I would greatly appreciate any help that is offered.

Thank you in advance!

Nik

1 Accepted Solution

Avatar

Correct answer by
Level 10

Another approach:

1. Kee the minimum instance as 1 but hide the 1st row.

2. Upon clickin the add button add a new instance and set the presence property to 'visible'

Nith

View solution in original post

3 Replies

Avatar

Former Community Member

Ok, I answered part of my question. I found out why I was getting error messaes.

I would still like to know however, how i can have a minimum of 0. Does anyone know if this is possible?

thank you

Avatar

Correct answer by
Level 10

Another approach:

1. Kee the minimum instance as 1 but hide the 1st row.

2. Upon clickin the add button add a new instance and set the presence property to 'visible'

Nith

Avatar

Level 2

Yes, you can have a subform with its occurrence set as 0 and then added when a user clicks an add button.

In a simple form I have a button with the following script _Subform1.addInstance();

There is a subform named SubForm1 that exists and has on the binding tab of the object Repeat Subform for Each Data Item "checked"

The min, max and initial count are not selected.    This will have it that when the form is rendered there is no instance of 'Subform1' and that when the add button is pressed then 'Subform1' is added once.