mirror of
https://github.com/seigler/govobject-proposal
synced 2025-07-27 06:46:10 +00:00
disable/enable fee Transaction input field
This commit is contained in:
parent
6a24251860
commit
57c9415e12
1 changed files with 4 additions and 2 deletions
|
@ -150,11 +150,11 @@
|
|||
if (isAlphaNumeric(txidfield.val())) {
|
||||
txidfield.unbind( "change" );
|
||||
console.log('feeTxid seems good: ' + txidfield.val());
|
||||
//$("#feeTxid").attr("disabled", true);
|
||||
console.log("wait while we check the api!");
|
||||
|
||||
// first check if transactionid is already in api
|
||||
$.getJSON(apiserversocket + 'insight-api-dash/tx/' + txidfield.val(), function(data) {
|
||||
txidfield.attr("disabled", true);
|
||||
var confirmations = data.confirmations;
|
||||
console.log('Transaction has ' + confirmations + ' confirmation(s)');
|
||||
if (confirmations != 'undefined' && $.isNumeric(confirmations)) {
|
||||
|
@ -205,14 +205,16 @@
|
|||
}
|
||||
else {
|
||||
console.log('Something went terribly wrong. Faulty api data?');
|
||||
txidfield.attr("disabled", false);
|
||||
}
|
||||
}).fail(function(jqXHR) {
|
||||
if (jqXHR.status == 400) {
|
||||
// there seems to be a problem with your feeTxid because txid is not found in api
|
||||
console.log('problem with feeTxid! Ask for new input!');
|
||||
alert("Check again and please enter your correct TxID!");
|
||||
$("#feeTxid").attr("disabled", false);
|
||||
txidfield.attr("disabled", false);
|
||||
} else {
|
||||
txidfield.attr("disabled", false);
|
||||
console.log('There seems to be a problem with the api connection');
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue