bookmark_borderPoll Shortcode

The Poll 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 Poll 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.

Example:

[gravityform action="polls" id="1" mode="poll" style="red" cookie="1 month" show_results_link="true" display_results="true" percentages="true" counts="true"]
  • id
    The id of the form to be embedded. (required)
  • 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 4 built in styles: red, green, orange, blue. Defaults to ‘green’. (optional)
  • cookie
    Enables blocking of repeat voters. You enable this by passing a defined time period. Available time periods 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 no repeat voters are blocked.
  • 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? Support 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? Support values are: true, false. Defaults to ‘true’. (optional)
  • counts
    Display number of times each choice has been selected when displaying results? Support 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 Poll shortcode action are optional. A form can be presented as a Poll without including most of these parameters. For example, to present a form as a poll using a minimal number of options and relying on defaults you could use the following: