# Create a "Petition" style form

**URL:** <https://community.gravityforms.com/t/create-a-petition-style-form/4841>\
**Category:** Get Help\
**Created:** [May 18, 2020, 5:18pm UTC](https://community.gravityforms.com/t/create-a-petition-style-form/4841 "2020-05-18T17:18:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5a7a859805f263.0](https://avatars.discourse-cdn.com/v4/letter/u/9f8e36/32.png) [@user5a7a859805f263.0](https://community.gravityforms.com/u/user5a7a859805f263.0)\
**Post date:** [May 18, 2020, 5:18pm UTC](https://community.gravityforms.com/t/create-a-petition-style-form/4841/1 "2020-05-18T17:18:07Z")

</div>

Hi Gravity Form Community,  
I’m working on a project where we want our visitors to sign a Pledge on our Website. (Like a petition). But in order to encourage people to sign the form, we want to have two things that we don’t know how to do:

1. A counter that display the total number of entry of the form (but we want to be able to enter manual numbers to control the total number of entries)
2. We want to display on the website  
“Jane S. - Los Angeles - Pledged 30 seconds ago”  
“Patrick P. - San Diego - Pledged 30 seconds ago”  
like on this picture :  
 ![pledge_example](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/8/828e999dc960e0bb596eaf84305efb4bba1da738.jpeg)  
Is there a way to do this with ad ons ?  
Thanks!  
Tim

---

<div class="post-metadata">

**Author:** ![top-node](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@top-node](https://community.gravityforms.com/u/top-node)\
**Post date:** [May 18, 2020, 5:57pm UTC](https://community.gravityforms.com/t/create-a-petition-style-form/4841/2 "2020-05-18T17:57:44Z")

</div>

Off the top of my head, I think you can do this without an add-on.

1. Total number of form entries  
Using the “pre\_render” hook, you can call the number of form entries using the GFAPI like so (from [https://docs.gravityforms.com/api-functions/#count-entries](https://docs.gravityforms.com/api-functions/#count-entries)):

and then display it at the beginning. If you want to be able to add a manual counter, create a shortcode that uses the same code above but add a “minimum” as an attribute (I’m assuming you want to show that there are a certain number of pledges before showing the exact number).

1. List of entries with timestamp:  
This is similar to #1. Create a shortcode that displays the last X entries using this code (from #get-entries):

To get the datetime stamp as a “pledged 30 seconds ago”, you’ll need some “timeago” functionality, e.g. [https://www.webslesson.info/2016/03/facebook-style-time-ago-function-using-php.html](https://www.webslesson.info/2016/03/facebook-style-time-ago-function-using-php.html) .

The city (e.g. “Los Angeles”) probably comes from your form.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [May 18, 2020, 7:51pm UTC](https://community.gravityforms.com/t/create-a-petition-style-form/4841/3 "2020-05-18T19:51:24Z")

</div>

Hi Timothy. There is this free solution to display the number of entries, via a shortcode:

> **[Shortcode: Display Number of Entries Submitted - Gravity Wiz](https://gravitywiz.com/shortcode-display-number-entries-submitted/)**
>
> Extends the \[gravityforms\] shortcode, providing a custom action to retrieve the total entry count for a given form. Also supports retrieving entry counts by entry status (i.e. "trash", "spam", "unread", "starred").

For the social proof (“Patrick P. - San Diego - Pledged 30 seconds ago”) you could use this:  
[https://www.gravityproof.co/](https://www.gravityproof.co/)

---

<div class="post-metadata">

**Author:** ![user5a7a859805f263.0](https://avatars.discourse-cdn.com/v4/letter/u/9f8e36/32.png) [@user5a7a859805f263.0](https://community.gravityforms.com/u/user5a7a859805f263.0)\
**Post date:** [May 18, 2020, 8:20pm UTC](https://community.gravityforms.com/t/create-a-petition-style-form/4841/4 "2020-05-18T20:20:59Z")

</div>

Wow cool!

Thank you so much. It looks like exactly what we need. I will look in details into all the options.

Thanks for the quick answer!

Tim

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 5, 2022, 8:47am UTC](https://community.gravityforms.com/t/create-a-petition-style-form/4841/5 "2022-01-05T08:47:07Z")

</div>

Closed on January 5, 2022, 8:47am UTC


