       else
         $('.form-actions .primary').attr("disabled",null)
 
-    toggleTransporterInput: ->
-      @line.find('*[data-field="item-delivery-mode"]').click (event) =>
-        target = event.target
-        if target.value == 'transporter'
-          @line.find('.transporter-delivery-mode').removeClass('hidden')
-        else
-          @line.find('.transporter-delivery-mode').addClass('hidden')
+    toggleInputVisibility: ->
+      @line.find('input[data-input-to-show]').click (event) =>
+        element = $(event.target)
+        if element.is("input[type='checkbox']")
+          if element.is(':checked') == element.data('with-value')
+            @line.find(element.data('input-to-show')).removeClass('hidden')
+          else
+            @line.find(element.data('input-to-show')).addClass('hidden')
+        else if element.is("input[type='radio']")
+          if element.val() == element.data('with-value')
+            @line.find(element.data('input-to-show')).removeClass('hidden')
+          else
+            @line.find(element.data('input-to-show')).addClass('hidden')
 
     oldForm: ->
       # console.log 'oldForm:this', this

        clone.removeClass('hidden')
        @_bindButtons(@newForm())
        @setFormSubmitable()
        @toggleTransporterInput()

    _bindSelectorsInitialization: ->
      that = this

        iceberg = new Iceberg($(inserted), "add") if inserted?
      $('*[data-unit-name]').each ->
        $(this).find('.item-population-unit-name').html($(this).attr('data-unit-name'))

) jQuery
