Hello! I know this has been answered a few times but I am still struggling with recording amount of times a participant has clicked on a custom button I have - in fact I have 10 custom buttons and I want to see which/how many of those buttons were clicked. Here is my html:
If anyone could assist I would be sincerely grateful!
Best answer by ChiragK
Create 3 embedded data field in survey flow named "button1_clicks", "button2_clicks", "button3_clicks", and then use following code. Hope that helps :) Qualtrics.SurveyEngine.addOnReady(function () { var button1Click = 0, button2Click = 0, button3Click = 0; jQuery("#button1").click(function () { Qualtrics.SurveyEngine.setEmbeddedData('button1_clicks', ++button1Click); jQuery("#infodiv1").toggle(); });
Create 3 embedded data field in survey flow named "button1_clicks", "button2_clicks", "button3_clicks", and then use following code. Hope that helps :) Qualtrics.SurveyEngine.addOnReady(function () { var button1Click = 0, button2Click = 0, button3Click = 0; jQuery("#button1").click(function () { Qualtrics.SurveyEngine.setEmbeddedData('button1_clicks', ++button1Click); jQuery("#infodiv1").toggle(); });