I am trying to:
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:
<div class="row">
<div class="col-sm-6"><label>Line Item</label>
[cred_generic_field type='select' field='estimate-line-item' class='form-control' output='bootstrap' select_text='--- not set ---']
{
"required":1,
"persist":1,
"options":[wpv-view name="list-rep-line-items"]
}
[/cred_generic_field]
</div>
</div>
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.
Thanks,
Matt
Lou,
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.
Thanks,
Matt
I assume you are going to setup multiple instance generic field in Toolset form, if it is, there isn't such kind of built-in feature within Toolset Forms plugin, you can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Thanks for looking into this for me Lou!