   single_defer = $.Deferred()
   group_defer = $.Deferred()
   single_encryption(form, values, (result) ->
-    console.log(result)
     single_defer.resolve()
   )
   $.when(single_defer).done(()->
     group_encryption(form, values, (result) ->
-      console.log(result)
       group_defer.resolve()
     )
   )
   $.when(single_defer, group_defer).done(() ->
-    #console.log values
-    #reinsert_values values
-    #form.submit()
+    reinsert_values values
+    form.submit()
   )
 
   #  source_encryption_names = find_names_for(form, "*[data-encrypt-source]")

      defers.push d
      encrypt(element.value, (result_string)->
        element.value = result_string.toString()
        console.log "#{element.name} finished encryption"
        d.resolve()
      )


    if contains(element.name, encryption_source_names)
      element.value = ""

write_target = (buffer, data, callback)->
  target_name = $("*[data-encrypt-target]").attr("name")
  if target_name
    encrypt(buffer, (result_string) ->
      for element in data
        if element.name == target_name
          element.value = result_string.toString()
      callback(data)
    )
  else
    console.error("No target defined")
