mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 11:38:12 +00:00
use web3.isAddress instead of custom regexp
This commit is contained in:
parent
aca98050ba
commit
e18fe47dbf
@ -43,9 +43,9 @@
|
||||
|
||||
function validateNamereg() {
|
||||
var address = document.getElementById('namereg').value;
|
||||
var ok = /^(0x)?[0-9a-f]{40}$/.test(address) || address === 'default';
|
||||
var ok = web3.isAddress(address) || address === 'default';
|
||||
if (ok) {
|
||||
namereg = address === 'default' ? web3.eth.namereg : Namereg.at(address);
|
||||
namereg = address === 'default' ? web3.eth.ibanNamereg : Namereg.at(address);
|
||||
document.getElementById('nameregValidation').innerText = 'ok!';
|
||||
} else {
|
||||
document.getElementById('nameregValidation').innerText = 'namereg address is incorrect!';
|
||||
|
Loading…
x
Reference in New Issue
Block a user