I'm fairly new to programing and solidity, still on the learning curve of things here.... So right now I'm trying to check for the balance in Wei of the account I submit into the text field (Account). How do I achieve this functionality?
My html code for this in index.html is;
<h1>Check</h1>
<br><label for="acctAddress">Account:</label><input type="text" id="acctAddress" placeholder="e.g., 0x93e66d9baea28c17d9fc393b53e3fbdd76899dae"></input>
<br><br><button id="check" onclick="checkBalance()">Check Balance</button>
<br>
<h3>You have <span class="green"><span id="acctBalance"></span> META</span>
</h3>
The Metacoin Solidity in MetaCoin.sol function is;
function checkBalance(address _account) returns (uint balance) {
return balances[_account];
}
The JavaScript function in app.js is
function checkBalance() {
var acctAddress = document.getElementById("acctAddress").value;
var check_element = document.getElementById("acctBalance");
setStatus("Retreving Balance... (please wait)");
web3.eth.getBalance(acctadd)
acctAddress = acctadd;
}
};