On line 2 and line 16 you have form 6 specified in your filter name. You can duplicate these code blocks and change the 6 to your additional form ID, to apply to another form. But if the code is exactly the same, you probably want to change the filter names to these:
[php]
add_action('gform_pre_render', 'add_surcharge_js');
[php]
add_filter("gform_product_info", "add_surcharge", 10, 3);
Then in the code below, add a condition to check for multiple form ids. Something like this:
http://pastebin.com/5vPsHQXW
I used an array for form IDs with 6 and 9. Change the 9 to your second form ID on both line 6 and line 28. You can add more form IDs in the array as well if you need to apply this code to more forms.
Posted 13 years ago on Tuesday September 6, 2011 |
Permalink