Page 1 of 1

Voting Buttons

PostPosted: Thu Nov 27, 2014 11:42 am
by cormac.conn
Hi guys,

I need some help with a relatively straight forward project. I need to create two buttons in WD that allow users to vote whether they liked the event or not. I need WD to compile how many times each button is pressed, so at the end of the event I can hand the client a file that says "X number of people enjoyed the event, X number of people didn't".

Is there an easy way of doing this?

Re: Voting Buttons

PostPosted: Thu Nov 27, 2014 12:51 pm
by Dennis Kuypers

There sure is!

1. Create two Integer Variables (using Tools > Variable List*), lets name them "good" and "bad"
2. Create two CustomScript Buttons, one for good and one for bad. The script for the good button is
Code: Select all

and for the bad
Code: Select all

3. You could create a Label to display, just tick Variable Source and type either "good" or "bad".
4. Create a textbox (maybe on a hidden/different page)
Everytime you want to store your results you can run something like this
Code: Select all
' Start with a clean box
' Write the information
WDTextBoxAppend,1, liked your event
WDTextBoxAppend,1, did not

' Reset Variables

' Store to txt file
' I don't know the command right now, but there is a "save textbox to file" script...


* PRO only feature. You can create variables in STD via script as well. For that create a custom script button and put in its "Click Script"
Code: Select all

Re: Voting Buttons

PostPosted: Thu Nov 27, 2014 2:16 pm
by cormac.conn
Dennis, you are awesome. That works like a charm! Thanks!