Skip navigation |

Accumulator Forms

This feature can be used if you want to track how many people are taking part in an event you are holding. There are two different types of accumulator, which are described on this page.

Last updated: 09 May 2012, 15:55

This feature needs to be enabled for your site before you can follow the steps below. Please email help@cubik.co.uk if you would like to use this feature.

Count the number of times a form is submitted

This method could be used if you wanted to count how many people are holding events (e.g. a Coffee Morning)

Firstly, create a standard Web Form template using whatever fields you choose. Set the Custom Form Handler to Accumulator Form.

Accumulator Form Handler

Save the Form, noting the exact Name value that you give to the form. Do not use spaces in the name.

Once you have approved your form, the form can be submitted. Each time the form is submitted, the accumulator will increase by 1.

Keep a running total of submitted values

This method would be used if you wanted people to give you a number, for example if you are asking your visitors to hold their own events, you could ask them how many people are attending their event, or how many cups of coffee they are making, to allow you to calculate the total.

Create the form in the same way as above, making sure to set the Custom Form Handler and make a note of the name of the form.

Then, add any number of fields to the form using the input type of Number. Add the word Accumulate (case sensitive) to the Parameters box.

When you submit the form, the accumulator will increase by the numbers entered into the fields, instead of by 1.

Viewing and manually editing the counter

To view the number of times that the form has been submitted, go to the Control Panel and click Accumulator Forms.

Accumulator Forms link

You will see the total value of the counter. Click the name of the counter to manually edit the value. If you want to delete the counter, remove the value from the box and click Update.

Edit Accumulator

Showing the value of the counter

To show the value of the counter on your website, enter the following into any editable area:

{customcontent::accumulatorcounter_xxxx}

Where xxxx is the Name that you gave to your form.

Including an image

If you want to show an image in place of the value above, add the text '_image' after the name of your form to include the image:

{customcontent::accumulatorcounter_xxxx_image}

Your images need to be stored in a Resource Gallery called AccumulatorFormImages. The images must be in either JPG, GIF or PNG format.

The images must be called xxxx_yyyy.zzz where xxxx is the name of your form, yyyy is the maximum value of the counter that you want that image to display for and zzz is the file extension.

Accumulator Images

In the above example, cupsoftea_20.jpg will show until the counter gets to 21, after which cupsoftea_40.jpg will show until the counter gets to 41, after which cupsoftea_100.jpg will show.

Increasing multiple counters on one form

It is possible to increase more than one counter using the same form. For example, if you wanted to count how many coffee mornings were being held, and also how many cups of coffee were being made with one form submission.

To do this, you would create your form as described above (e.g. with a name of CoffeeMornings). In your Number field, instead of typing Accumulate in the parameters, type Accumulate_CounterName.

When submitted, the CoffeeMornings counter would increase by 1, and the CounterName counter would increase by the number typed in the field. You could then output the values of both counters as described above.

Note that the counters are not specific to the form that they are on, so be careful not to duplicate the names of any counters.

Ensure your page does not get cached

To ensure that the counter values do not get cached, ensure to set the NoClientCache custom property to True on any pages where you include a counter output.

No Client Cache Custom Property

If you have any problems setting up your Accumulator, please Contact the Helpdesk

 

Cookies are used by nearly every website to improve your web browsing experience. Recent government legislation (the e-Privacy Directive) means that we are obliged to seek your agreement to the use of cookies when you visit our website. Two of the cookies that we use are essential for this website to operate and have already been set. You may delete and block all cookies from this site, but if you do so, parts of the site will not work. To find out more about the cookies that we use, please see our privacy policy.