I am an amateur at coding and have been researching for many days trying to solve my problem with no success. Hoping that someone maybe able to help me with my issues.
I am conducting a survey across the whole of Australia (hoping for millions of responses) (external poll maker embedded within my website) and after the survey is completed the client is redirected to a page within my website. This page has a popup modal where I am trying to achieve that the client clicks on a button that adds their response to the counter. Only one click per person allowed so that the counter is accurate. (As the external poll maker program/people do not have a counter when the finish button is pressed).
I would like the counter to keep a progressive/cumulative count (I have noted in my research that a database is required to do this, which I do not know how to achieve). It would be preferred if the outcome of the counter displayed like the "counter up" versions such as example https://codepen.io/SeanWhelan/pen/bErZYo
I would also like to display this same "counter up" counter tally in a secondary place on the page next to the survey to let people know how many people have completed the survey before they start their survey. If a "counter up" is not achievable, I would be more than happy just to get an accurate count as a basic number.
I would be most grateful if someone is able to help me achieve a solution. Thank you
I have managed to get the counter only to count one click per person using the following code
<div class="modal-body" align="center">
Add your vote count to the counter.
<p>Clicks: <a id="clicks">0</a></p>
<button type="button" onClick="clickME(this)">Click me</button>
</div>
with the below script
<!-- Click Counter -->
<script>
var clicks = 0;
function clickME(el) {
el.disabled = true;
clicks += 1;
document.getElementById("clicks").innerHTML = clicks;
}
</script>
I know that this at the moment only counts 1 count and then does not keep record of the count, this is all I have been able to achieve.
However I would really like the counter displayed like a "counter up" version that will increase its grand total by one each time a new client clicks on the button (but as said previously, if it is only a basic number that displays I would be happy.
Any help would be appreciated.
EDIT: This is an example of the section of the code for the embedded survey. The code for the script is provided by the the third party survey program/people. Do you think that any code could be added inside this script to enable a count tally to automatically happen upon submitting the clients answers to the survey?
<!-- Survey Section -->
<div class="w3-content w3-left-align w3-text-black w3-padding-28" id="survey">
<h3>Take The Survey</h3>
<a data-quiz="QFUCA582E" data-type=4 href="https://poll-maker.com/QFUCA582E">Loading...</a><script>(function(i,s,o,g,r,a,m){var ql=document.querySelectorAll('A[quiz],DIV[quiz],A[data-quiz],DIV[data-quiz]'); if(ql){if(ql.length){for(var k=0;k<ql.length;k++){ql[k].id='quiz-embed-'+k;ql[k].href="javascript:var i=document.getElementById('quiz-embed-"+k+"');try{qz.startQuiz(i)}catch(e){i.start=1;i.style.cursor='wait';i.style.opacity='0.5'};void(0);"}}};i['QP']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.poll-maker.com/3012/CDN/quiz-embed-v1.js','qp');</script>
</div>