Summary
The Polls shortcode uses the standard Gravity Forms shortcode but introduces a new action that tells Gravity Forms to make the form behave as a poll. The Polls shortcode can be used anywhere within WordPress where shortcodes are supported. For most users, this will primarily be within the content of a WordPress post or page.
Here is an example Poll shortcode showing passed parameters.
[gravityform action="polls" id="1" field="1,2,3" mode="poll" style="red" cookie="1 month" show_results_link="true" display_results="true" percentages="true" counts="true" \]
Parameters
Parameter | Description |
---|---|
id | The id of the form to be embedded. (required) |
field | You can choose to display the poll result of a field or fields. Defaults to all fields. (optional) |
mode | You can choose to display the poll or just the results of the poll. Supported modes: poll or results. Defaults to ‘poll’. (optional) |
title | Shows or hides the form title. Defaults to true. |
description | Shows or hides the form description. Defaults to true. |
confirmation | Enables or disables the confirmation message on the form. Defaults to false. |
style | The add-on currently supports four built in styles: red, green, orange, blue. Defaults to ‘green’. (optional) |
cookie | Sets a time period to restrict repeat voting, using a browser cookie. Options are 1 day, 1 week, 1 month, or a specific date in the YYYY-MM-DD date format. Defaults to an empty string, which means repeat voting is permitted. |
show_results_link | Display a link to view poll results without submitting the form. Supported values are: true, false. Defaults to ‘true’. (optional) |
display_results | Display poll results automatically when the form is submitted. Supported values are: true, false. Defaults to ‘true’. (optional) |
ajax | Enables or disabled AJAX submission of the poll. Defaults to false. |
percentages | Display results percentages as part of results. Supported values are: true and false. Defaults to ‘true’. (optional) |
counts | Display number of times each choice has been selected when displaying results. Supported values are: true, false. Defaults to ‘true’. (optional) |
tabindex | Sets a custom tab index on the poll. Accepts numerical values. |
Most of the parameters available for the Polls shortcode action are optional. A form can be presented as a poll without including most of these parameters.