Disabling Automatic Scrolling On Form Confirmations

Disabling Automatic Scrolling On Form Confirmations

Use the gform_confirmation_anchor FilterDisabling Automatic Scrolling On a Specific FormDisabling Automatic Scrolling On All Forms

When a form is submitted, the default behavior of Gravity Forms is to scroll to the confirmation message. In the vast majority of cases, this is the desired behavior, but in a few scenarios, you may want to disable this functionality.
Use the gform_confirmation_anchor Filter
Gravity Forms makes it incredibly easy to remove this functionality by providing an easy to use filter.
This filter will be used either within its own plugin (ideally) or within your theme』s functions.php file.
Note: Placing modifications within your own plugin is recommended simply because it makes your changes immune to theme updates. If placed within your theme, your changes could be overwritten by theme updates.
Disabling Automatic Scrolling On a Specific Form
To disable automatic scrolling on a specific form, use the gform_confirmation_anchor filter like so, replacing # with the form ID:
add_filter( 'gform_confirmation_anchor_#', '__return_false' );

Disabling Automatic Scrolling On All Forms
Disabling automatic scrolling on all forms is just as easy as disabling it on a specific form. Use the filter like the following:
add_filter( 'gform_confirmation_anchor', '__return_false' );

Disabling Mobile Keyboard Input on Datepicker Fields

Disabling Mobile Keyboard Input on Datepicker Fields

This quick block of Javascript will allow you to disable keyboard input within Date fields. This snippet is helpful if you need to avoid the virtual keyboard from appearing within the datepicker.

Display a message on the login form when the user is pending activation

Display a message on the login form when the user is pending activation

This example shows how the WordPress authenticate filter can be used to check if the user attempting to login is still pending activation so a custom message can be displayed instead of the standard unknown username or email message.

add_filter( 'authenticate', function ( $user_or_error, $username_or_email ) {
// Abort if the user has already been authenticated or the UR add-on is not active.
if ( $user_or_error instanceof WP_User || ! function_exists( 'gf_user_registration' ) ) {
return $user_or_error;
}

// Abort if authentication failed for an unsupported reason.
if ( is_wp_error( $user_or_error ) && ! in_array( $user_or_error->get_error_code(), array(
'invalid_username',
'invalid_email',
) ) ) {
return $user_or_error;
}

add_filter( 'gform_user_registration_pending_activation_expiration', 'authenticate_pending_activation_expiration' );
$key = strpos( $username_or_email, '@' ) ? 'user_email' : 'user_login';
$is_pending = gf_user_registration()->pending_activation_exists( $key, $username_or_email );
remove_filter( 'gform_user_registration_pending_activation_expiration', 'authenticate_pending_activation_expiration' );

// If there isn't a pending activation return the original error.
if ( ! $is_pending ) {
return $user_or_error;
}

$custom_error_message = 'Account is pending activation.';

// If the UR login form is being used add the error to the first field.
if ( isset( $_POST['gform_submit'] ) && absint( $_POST['gform_submit'] ) === 0 ) {
$field = GFAPI::get_field( gf_user_registration()->login_form_object(), 1 );
$field->failed_validation = true;
$field->validation_message = $custom_error_message;
}

return new WP_Error( 'pending_activation', $custom_error_message );
}, 30, 2 );

// Callback for the gform_user_registration_pending_activation_expiration hook.
// Prevents the pending activation being deleted by the pending_activation_exists() check if it is a few days old.
function authenticate_pending_activation_expiration() {
return YEAR_IN_SECONDS;
}

This code snippet is compatible with both the standard WordPress login form and the login form included with the User Registration Add-On.

PHP based code snippets like this can be added to the theme functions.php file or a custom functions plugin.

Displaying a Form Within a Modal/Popup/Lightbox

Displaying a Form Within a Modal/Popup/Lightbox

IntroductionObtain the Popup Maker pluginEmbed your Form

Note: This tutorial is provided as a suggestion only. We do not support third party solutions. If you have any troulbe using Popup Maker, please contact with its author.

Introduction

Sometimes you may want to display your form within a box that will display over the current page. This is especially handy when encouraging newsletter signups on your site. In this article, we will show you how to embed any forms made with Gravity Forms into a popup window in just a few steps using a third-party plugin.

Obtain the Popup Maker plugin

The easiest way to create a popup window and embed Gravity Forms into it is to do so using the Popup Maker plugin. Simply download and install the Popup Maker plugin either from within your WordPress admin dashboard or manually.

Embed your Form

To embed your form, it』s as simple as creating a new popup, and embedding your form just as you would any other post or page. To do so, simply click the Add Form button.

When embedding your form, ensure that AJAX is enabled to avoid the page refreshing. To do so, either use the Enable AJAX checkbox when adding a form using the button, or add ajax=」true」 to your Gravity Forms embed shortcode.

¿Need more help creating your popup? Please contact the Popup Maker author for further assistance and tips.

Displaying Your Poll Results to Visitors

Displaying Your Poll Results to Visitors

IntroductionShow results after submissionShow results immediately Display a link to view resultsDo not show results

Introduction

This article shows the various options you have when it comes to showing poll results to your site visitors. In most cases, a Gravity Forms poll can display both poll questions and/or the poll voting results, dependent on configuration.

To view poll results as a site administrator in the back end, refer to this article.

Show results after submission

Showing the Poll question first, and then displaying the poll results after a user submits the poll is a standard behavior used on many websites.

For a Poll block, set Mode to poll.For the Poll shortcode, set the Mode parameter to poll.For the Poll widget, set Display Mode to poll.

Show results immediately

You can also choose to display the current poll results immediately on page load, skipping the display of the Poll form itself.

For a Poll block, set Mode to results.For the Poll shortcode, set the Mode parameter to results.For the Poll widget, set Display Mode to results.If in a place where you can use merge codes, you can use either of these merge tags.

Display a link to view results

To display a view results link at the bottom of the poll question, so a visitor can choose to view the results only if they wish, use the following settings:

For a Poll block, this is controlled by the setting Display Link to Results Below Form.For the Poll shortcode, set parameter show_results_link to true.For the Poll widget, this is controlled by the Display Mode setting.

Do not show results

In the specific case where you wish to show only the poll questions, and no poll results (or link to poll results) at all, use the Poll shortcode and set the parameters of display_results and show_results_link to false.

Does Gravity Forms Support HHVM?

Does Gravity Forms Support HHVM?

Correcting File Upload Errors

While Gravity Forms is not tested on HHVM, in many cases it will operate properly out of the box or with a few modifications. As HHVM does have some incompatibilities with standard PHP releases, issues can arise from time to time and not all of these can be addressed. In this article, we will list any workarounds that may be required when running Gravity Forms with HHVM.
Correcting File Upload Errors
The File Upload field may have issues in some HHVM setups due to how the WordPress wp_max_upload_size function retrieves the values of the PHP upload_max_filesize and post_max_size settings. To correct this, simply place the following in your theme』s functions.php file (or ideally within its own plugin):
add_filter( 'upload_size_limit', function() {
$u_bytes = wp_convert_hr_to_bytes( ini_get( 'hhvm.server.upload.upload_max_file_size' ) );
$p_bytes = wp_convert_hr_to_bytes( ini_get( 'hhvm.server.max_post_size' ) );

return min( $u_bytes, $p_bytes );
} );

Does Gravity Forms Support ….

Does Gravity Forms Support ….

You can embed the Gravity Forms shortcode anywhere within your WordPress site, independently from other plugins. But to talk effectively and get closer integration between Gravity Forms and a third party service, we recommend:

Our library of community supported third-party plug-ins, which contains hundreds of solutions for enhancing and extending Gravity Forms.
Using Zapier to link with other services

Examples:
– does Gravity Forms support WooCommerce?
– does Gravity Forms support SalesForce?
– does Gravity Forms support my payment gateway?

Donations Settings in the PayPal Payments Standard Add-On

Donations Settings in the PayPal Payments Standard Add-On

Transaction Type-specific Options

When using the PayPal Add-Ons for Gravity Forms, you can set various transaction types depending on your needs such as Products and Services, Subscription, and Donations.

Transaction Type-specific Options

If you select Donations from the Transaction Type drop down, the option below will appear.

The Payment Amount setting denotes which field will be used for the payment amount. It can be set to Form Total or an additional field that you have configured.

If you need more information on configuring feeds within the PayPal Payments Standard Add-On, you may review our article on Creating a Feed for the PayPal Payments Standard Add-On.

Downloading a Gravity Forms Add-On

Downloading a Gravity Forms Add-On

Pre-RequisiteDownloadingInstalling an Add-OnSetting up an Add-On

Pre-Requisite
To download an Add-On, you must be have at least one active Gravity Forms license of the appropriate level. To see which Add-Ons are available with your license type, review our Add-Ons page. If you own multiple license types, you will have access to downloads based on the highest level of active license you own.
Downloading
To download an Add-On via the Gravity Forms website, navigate to the Gravity Forms account login page and login with your Gravity Forms credentials. Then click Downloads in the submenu to see all the files available for download.
Note: Files will download in the ZIP archive file format. Do not unzip it (or allow your browser to unzip it automatically). When you install it, you will upload it in the ZIP format.
You can also install directly via the admin area of your WordPress site. Login to your dashboard and go to Forms > Add-Ons. From here you can install any official Gravity Forms Add-On that is permitted by your license level.
Installing an Add-On
Your next step is to install the Add-On. Refer to this article for the various installation methods.
Setting up an Add-On
Each Add-On can have different set-up and activation requirements. Refer to the appropriate add-on documentation section for advice on any setup required for your Add-On.