I want to create a form for Purchase Order with the ability to add products right in the form. Basically, the user will input all of the information, and somewhere in the form, there is an added product section. It is simple, the user will select a product in dropdown select and then the user will click or press “add product” and the same dropdown will appear so the user will be able to select another product. Then if the user wants to add more products just click the same button again.
Think of it as a “list” with a dropdown select inside. Is this possible?
Thanks, @chrishajer! Already implemented this, I have two columns one is with the dropdown and I want the other one with some sort of validation like only accepting numbers only. How to achieve that?
Hi Waren. Changing that input to a number type is not currently supported. If you need front end validation (to prevent non-numbers from being entered) you will need to create the JavaScript to handle that validation up front. You could instead use the gform_field_validation filter to check the input once they submit the page, to ensure that what they submitted was a number, and return a validation error if it was not.
This is the filter I was recommending:
If you have any other questions, please let us know.
Thanks, @chrishajer currently I was looking at this solution and working on applying this on the front-end. Thank you!
Another question, I successfully added few items in the dropdown selection. However, is there any way to create some sort of adding items to dropdown selection without hardcoding it in the functions.php file?
I’m thinking of creating a REST API using Google Sheet or creating a custom product post type and use the data in that dropdown selection.
Basically, making the dropdown selection dynamic so the client can add products without editing the code.