I've created a form to allow users to create estimates. I've created a view that displays all of the products and services stored in the woocommerce products post type. I'd like users to be able to add multiple line items to the estimate form.
I've created a custom field for this that has the "Allow multiple instances of this field" option checked, and I'm using a cred generic field to display the options. Is there any way for a cred_generic_field to have the "Add New" button under it in the form as other single line fields can do?
Here is what the code for this generic field looks like so far:
Not the view works fine, it populates the drop down as expected. I'm currently attempting to duplicate the behavior by looking at single line fields that do allow multiple instances, and replicating the button and code that allows this, but thus far I've been unsuccessful.
Any help you can provide would be greatly appreciated.
I'm confused by your answer, you said generic fields only support two types of multiple choice fields, and link to the documentation, but nowhere in the documentation does it say that is the case. This is just an observation as I don't need a multiple choice field in this instance, there will be far too many options in the list to do a multi-select or checkboxes field.
What I really need is a select field that allows for multiple instances of the field to be added to the post form, or a work around so I can create something close to that. I'm also open to other options that you think may be suitable for this use case as I'm sure it's not the first time someone has needed to create an estimate module with line items.