diff --git a/bl-kernel/admin/views/new-content.php b/bl-kernel/admin/views/new-content.php index 4ac79b2a..52220332 100644 --- a/bl-kernel/admin/views/new-content.php +++ b/bl-kernel/admin/views/new-content.php @@ -466,18 +466,23 @@ foreach ($customFields as $field => $options) { // Button Save $("#jsbuttonSave").on("click", function() { + let actionParameters = ''; + // If the switch is setted to "published", get the value from the selector if ($("#jsbuttonSwitch").data("switch") == "publish") { var value = $("#jstypeSelector option:selected").val(); $("#jstype").val(value); + actionParameters = '#' + value; } else { $("#jstype").val("draft"); + actionParameters = '#draft'; } // Get the content $("#jscontent").val(editorGetContent()); // Submit the form + $("#jsform").attr('action', actionParameters); $("#jsform").submit(); });