WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP-Polls] Changing Number of Votes (2 posts)

  1. sparkweb
    Member
    Posted 4 years ago #

    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)}

  2. Lester Chan
    Member
    Posted 4 years ago #

    Thanks I shall take a look at it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags