Skip to content

Instantly share code, notes, and snippets.

Created April 12, 2018 18:14
What would you like to do?
window.submitVote = function(candidate) {
let candidateName = $("#candidate-name").val();
let signature = $("#vote-signature").val();
let voterAddress = $("#voter-address").val();
$("#msg").html("Vote has been submitted. The vote count will increment as soon as the vote is recorded on the blockchain. Please wait.")
Voting.deployed().then(function(contractInstance) {
contractInstance.voteForCandidate(candidateName, voterAddress, signature, {gas: 140000, from: web3.eth.accounts[0]}).then(function() {
let div_id = candidates[candidateName];
return {
$("#" + div_id).html(v.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment