Issues
On the voter system, the selected button up down usually reloads to count. How can that be stopped?
<form method=”post” id=”voteform” action=””>
<button type=”button” class=”btn btn-light” name=”up” title=”Vote Up ” style=”padding: .5vh 1vh; margin-top:3px;” onclick= <?php if ( is_user_logged_in()) { ?>
“upVote(<?php echo $answeridx; ?>)”<?php } else {?>
“window.location.href = ‘/wp-login.php’;” <?php } ?>
value =”<?php echo $answeridx; ?>”><i class=”fa-solid fa-thumbs-up”></i><div id=”up_count<?php echo $answeridx; ?>” class=”label-vote”><?php echo $var=0+$thumbsup; ?></div></button>
<div class=”label-vote”><?php //echo $thumbsup; ?></div>
<button type=”button” class=”btn btn-light” name=”down” title=”Vote down” class=”btn btn-light” style=”padding: .5vh 1vh; margin-top:3px;” onclick=<?php if ( is_user_logged_in()) { ?>
“downVote(<?php echo $answeridx; ?>)”<?php } else {?>
“window.location.href = ‘/wp-login.php’;” <?php } ?> value =”<?php echo $answeridx; ?>” >
<i class=”fa-solid fa-thumbs-down”></i><div id=”down_count<?php echo $answeridx; ?>” class=”label-vote”><?php echo $var=0+$thumbsdown; ?></div></button>
</form>