     $('#new_print').on 'submit', (e) ->
       e.preventDefault()
       form = new FormData(this)
+      newCid = $('#print_username').val()
 
       $.ajax
         url: this.action,

      .success (data) ->
        $('.printer-feedback-alert').hide()
        $('.printer-feedback-success').show()
      .error (err) ->
        errors = err.responseJSON.errors
        $('.printer-feedback-alert .msg').html($('<ul/>').html(errors.map (err) -> $('<li/>').text(err)))

# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
printer_local_storage_key = "last-printer-used"
cid_local_storage_key = "cid"

$ ->
  printer_name = localStorage.getItem(printer_local_storage_key)
  cid = localStorage.getItem(cid_local_storage_key)


  if (cid)
    $('#print_username').val(cid)

  if $('#print_printer').length

