Multiple entries into a database

0
I have a form, that is being entered into a database, i have posted a screenshot, i would like it so that when you press the plus symbol next to the phone number , it would open another text field for another phone number entry. This also means that on the database, under one entry in the database, there would be multiple phone numbers attached to this one entry. How would i be able to do this?    
asked
1 answers
1

Hi Jordan,

Should the user be able to enter just the second phone number, or do you want him to be able to keep adding phone numbers by clicking the 'plus' button?

 

In the first scenario I would just add an attribute to your entity featured in the form like 'SecondaryPhoneNumber' and show it on the page. If it really needs to be hidden at the start, you could work with conditional visibility and a boolean attribute to show/hide the field.

 

In the second option you can add an entity 'PhoneNumber' (or 'ContactDetails' with an enum Type 'Phone' so you could easily expand this with 'email' etc) and connect that entity to the one featured in the form. At creation of the form object always also create a PhoneNumber entity and show it in an editable listview on the page. The pklus sign can then add a new entity to the list view.

answered