Instead of this:
[php]
gform_submit_button_1
use this:
[php]
gform_submit_button
And then in the code below do this:
[php]
if($form['id'] == 1 || $form['id'] == 7 || $form['id'] == 5) {
// then return the custom button for forms 1, 5 or 7
You can use whatever PHP conditional you are comfortable with (I used simple OR logic). You could put the form IDs into an array and then check the array for the existence of the ID.
It might look like this when you are done:
[php]
// filter the Gravity Forms button type on Form ID 1
add_filter("gform_submit_button", "form_submit_button", 10, 2);
function form_submit_button($button, $form) {
if ($form['id'] == 1 || $form['id'] == 7 || $form['id'] == 5) {
return "<button class='button' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
}
}
Posted 12 years ago on Wednesday January 4, 2012 |
Permalink