WordPress.org

Support

Support » How-To and Troubleshooting » [Plugin: WP-Polls] Changing Number of Votes

[Plugin: WP-Polls] Changing Number of Votes

  • I’m using 2.5 and I ran into some trouble when trying to change the number of votes. I dug into it, and it looks like the jquery wasn’t cycling through all the number of votes fields and was just grabbing the last one. I’ve fixed it with a kludge, but you may need to look into this a little closer. Here’s my fix (I am just grabbing the size=4 input fields):

    function check_totalvotes(){
    temp_vote_count=0;
    jQuery(“#poll_answers tr td input[size=4]”).each(function(a){
    if(isNaN(jQuery(this).val())){temp_vote_count+=0}else{temp_vote_count+=parseInt(jQuery(this).val())}
    });
    jQuery(“#pollq_totalvotes”).val(temp_vote_count)}

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP-Polls] Changing Number of Votes’ is closed to new replies.