diff options
| author | Adam Soltys <[email protected]> | 2012-10-20 14:01:03 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2012-10-20 14:01:03 -0700 |
| commit | f43781b8955b7f689a9280f72c62803d676e396d (patch) | |
| tree | ed009d2807bc10836fa5d3d803b0aa80dd5c38da /js | |
| parent | 4331f041b4a98d34dac30f47d8c8762db8173c8a (diff) | |
| download | coinos-server-f43781b8955b7f689a9280f72c62803d676e396d.tar.gz coinos-server-f43781b8955b7f689a9280f72c62803d676e396d.zip | |
Clear amount field on focus
Diffstat (limited to 'js')
| -rw-r--r-- | js/bitcoin_pos.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/js/bitcoin_pos.js b/js/bitcoin_pos.js index 49bf5c14..23955a1b 100644 --- a/js/bitcoin_pos.js +++ b/js/bitcoin_pos.js @@ -58,23 +58,24 @@ $(function() { updateTotal(); }); - $('#owing').keyup(updateTotal); - $('#owing').focus(); - $('#owing').click(function() { + $('#amount').keyup(updateTotal); + $('#amount').focus(); + $('#amount').focus(function() { $('#payment').show(); $('#received').hide(); + $('#total').html('0'); + $(this).val(''); }); function updateTotal() { - var owing = parseFloat($('#owing').val()); - total = owing / exchange; + var amount = parseFloat($('#amount').val()); + total = amount / exchange; total = Math.ceil(total * 10000) / 10000; if (!$.isNumeric(total)) total = ''; $('#total').html(total.toString()); doqr('bitcoin:' + address + '?amount=' + total.toString()); } - $('input').click(function() { $(this).val(''); }); }); function getParameterByName(name) { |
