Remove the total votes displayed in Ajax Voting Script

Place for comments, problems, questions, or any issue related to the JavaScript / PHP scripts from this site.
purcelly
Posts: 5

Remove the total votes displayed in Ajax Voting Script

Is it possible to remove the total votes displayed on the simple vote version of the script ( https://coursesweb.net/php-mysql/voting- ... pt-ajax_s2 )?

I'm using the script successfully on a page but was hoping to use it also for a competition so no votes would display on my 4 options but would still record in the .txt file so I can collate them at the end and work the total out myself.

I edited the CSS to change the colour of the vote number to white so it's essentially hidden but obviously still shows when it's highlighted.

Is this possible?

Admin Posts: 805
Hi,
You can set in css "display:none;" for the element with the vote number.
Or, in the voting.js file edit this line of code (line 39):

Code: Select all

ivotings[elm_id].innerHTML = '<h4>'+ vote+ '</h4><span><img src="'+votingfiles+'votplus.gif" alt="1" title="Vote"'+ clik_up+ '/></span>';
For example, remove h4 element:

Code: Select all

ivotings[elm_id].innerHTML = '<span><img src="'+votingfiles+'votplus.gif" alt="1" title="Vote"'+ clik_up+ '/></span>';

purcelly Posts: 5
That's perfect thank you. I looked at everything but just kept breaking stuff haha