diff --git a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee index 9625d714c..a94ca35a8 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee @@ -1162,17 +1162,21 @@ class App.ControllerForm extends App.Controller @params: (form) -> param = {} + # create jquery object if not already exists + if typeof form isnt 'function' + form = $(form) + # find form based on sub elements - if $(form).children()[0] - form = $(form).children().parents('form') + if form.children()[0] + form = form.children().parents('form') # find form based on parents next