gform_next_button

gform_next_button

DescriptionUsageParametersExamplesChange input to buttonAppend a JavaScript action to the buttonSource Code

Description
The 「gform_next_button」 filter allows the markup for the next button to be changed, giving the user control over how it looks.
Usage
Apply to all forms.
1add_filter( 'gform_next_button', 'my_next_button_markup', 10, 2 );
Apply to a specific form.
1add_filter( 'gform_next_button_10', 'my_next_button_markup', 10, 2 );
Parameters

$next_button string
The default markup for the next button.

$form Form Object
The current form.

Examples
Change input to button
This example changes the default input type to use the button element with an included span, popular for implementing the Sliding Door CSS technique.
1234add_filter( 'gform_next_button', 'form_next_button', 10, 2 );function form_next_button( $button, $form ) {    return "";}
Note: The above is just a quick example showing how to use the filter. Using the above code will prevent the form submitting as the onclick attribute is missing.
Here』s another example which would change all the next, previous, and submit buttons so they use button elements from a single function while maintaining attributes such as onclick from original inputs.
1234567891011121314151617181920212223242526/** * Filters the next, previous and submit buttons. * Replaces the forms buttons with

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注