Voting Buttons

Moderator: Moderator Group

Voting Buttons

Postby cormac.conn » Thu Nov 27, 2014 11:42 am

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?
cormac.conn
 
Posts: 32
Joined: Mon Jul 01, 2013 11:20 am

Re: Voting Buttons

Postby Dennis Kuypers » Thu Nov 27, 2014 12:51 pm

Hey,

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
good+=1

and for the bad
Code: Select all
bad+=1

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
WDTextBoxClear,1
' Write the information
WDTextBoxAppend,1,good
WDTextBoxAppend,1, liked your event
WDTextBoxNewLine,1
WDTextBoxAppend,1,bad
WDTextBoxAppend,1, did not

' Reset Variables
good=0
bad=0

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


Regards
Dennis

* 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
VInt,good,0
VInt,bad,0
Dennis Kuypers
Product Developer, Software

Online Manual
User avatar
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: Voting Buttons

Postby cormac.conn » Thu Nov 27, 2014 2:16 pm

Dennis, you are awesome. That works like a charm! Thanks!
cormac.conn
 
Posts: 32
Joined: Mon Jul 01, 2013 11:20 am


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 4 guests