                   isSelectAllKey(event) or
                   isArrowKey(event)
 
-        inputVal = @inputAddress.val()
+        inputVal = @ui.inputAddress.val()
         @_clearErrors()
 
         if inputVal.length is 0

    id: 'address-form'
    tagName: 'article'

    events:
      'keydown .address-public-address': '_handleKeyupInput'
      'paste .address-public-address': '_handlePasteInput'
      'cut .address-public-address': '_handleCutInput'
      'click .btn-save': '_handleSave'
      'click .btn-cancel': '_handleCancel'

    initialize: ->
      @listenTo App.vent, 'scan:qr', @_handleScanQr

    onShow: ->
      @balance = @$('.address-balance')
      @currencyType = @$('.currency-type')
      @inputAddress = @$('.address-public-address')
      @inputName = @$('.address-name')
      @hiddenAddress = @$('.hidden-public-address')
      @hiddenAddressFirstbits = @$('.hidden-public-firstbits')
      @btnQrScan = @$('.scan-qr')
      @btnSave = @$('.btn-save')
      @btnCancel = @$('.btn-cancel')

    _handleKeyupInput:
      _.debounce (event) ->

      @_reset(false)

    _setCurrencyImage: (response) ->
      @ui.currencyType.addClass('is-filled').html $('<img />',
        src: response.currency_image_path
        alt: response.currency)

    _isValidAddress: (response) ->
      @_setCurrencyImage response
      @ui.btnQrScan.hide()
      @ui.btnSave.css('display', 'inline-block')
      @ui.btnCancel.css('display', 'inline-block')
      @ui.hiddenAddressFirstbits.text @ui.inputAddress.val().slice(0,8)
      @ui.inputAddress
        .addClass('is-valid')
        .css('width', @ui.hiddenAddressFirstbits.outerWidth())
        .prop('disabled', true)
      @ui.balance.text("#{response.balance} #{response.shortname}").show()
      inputNameWidth = @$('.address-input').outerWidth() - @ui.inputAddress.outerWidth() - @ui.balance.outerWidth() - 10
      @ui.inputName.css('width', inputNameWidth).show().focus()
      @

    _addError: ->
      @ui.inputAddress.addClass 'is-invalid'

    _clearErrors: ->
      @ui.inputAddress.removeClass 'is-invalid'

    _clearCurrencyImage: ->
      @ui.currencyType.removeClass('is-filled').html('')

    _reset: (clearAddress = true) ->
      @_clearErrors()
      @_clearCurrencyImage()
      @ui.btnQrScan.show()
      @ui.btnSave.hide()
      @ui.btnCancel.hide()
      @ui.inputName.val('').hide()
      @ui.balance.text('').hide()
      @ui.inputAddress.removeClass('is-valid').prop('disabled', false).css('width', '100%')
      @ui.inputAddress.val('') if clearAddress
