Possible? I.e. with gform_pre_render hook?
Possible? I.e. with gform_pre_render hook?
Not possible using gform_pre_render. Can you explain what you're trying to do? Maybe there is another way.
It's about dynamically generated forms, or whatever you want to call it.
Simply display field A only if var B has a value of C. If var B is an array with N elements, then display N fields.
The built-in conditional logic doesn't help me much here, as far as I understand it.
Paddelboot
Conditional logic will help you display form fields based on matching conditions as you describe. However, the elements need to already be present in the form you created in the form builder, so they can be shown conditionally.
If you can provide a more detailed explanation of what you want to do, we can help point you to the correct information.
Let's say you want to build a shopping cart form in which the customer can set the amount and/or other details about every item he wants to purchase.
You cannot know in advance how many items there will be in the shopping basket when you call the form.
Displaying the same form several times on the same page also seems to be problematic.
Therefore, you'd need to dynamically add fields to the form. Since, in the background, every form field is just an array with an amount of keys and values, this shouldn't be impossible.
I hope this is understandable now.
Paddelboot
So far, I have only found cforms II to be able to do this.
http://www.deliciousdays.com/cforms-plugin/
Check under API/Creating dynamic forms.
It's interesting that this feature seems not to be demanded by many users.
Paddelboot
I'll move this to feature requests so we don't forget about it. Thanks.