From 9c93be1d84e8fd7ac5c8a9f15d188a6e2f376b22 Mon Sep 17 00:00:00 2001 From: Thomas Luo Date: Mon, 19 Aug 2019 23:44:54 +0800 Subject: [PATCH] MISC inbound-reservation#892 - Change create form event capture method - change from depend_select.on('change') to $(document).on('change') to capture change event at document level --- app/views/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/_form.html.haml b/app/views/_form.html.haml index c1b8180c..ba971a30 100644 --- a/app/views/_form.html.haml +++ b/app/views/_form.html.haml @@ -71,7 +71,7 @@ var depend_select_id = "#{model_name}_#{column.options[:depend_column]}"; var depend_select = $("select#" + depend_select_id); - depend_select.on('change', function(){ + $(document).on("change", "select#"+depend_select_id, function(){ var current_select_id = "#{model_name}_#{column_name}"; var current_select = $("select#" + current_select_id); var key = $(this).val();