From 57c9415e120a58b70d58fedf50ef81e1a915f05d Mon Sep 17 00:00:00 2001 From: Cofresi Date: Thu, 10 Nov 2016 00:05:27 -0400 Subject: [PATCH] disable/enable fee Transaction input field --- index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 58c7994..c3ac21f 100644 --- a/index.html +++ b/index.html @@ -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'); } });