CMS edit-article (chiangmai, where-else): remove duplicate #btn_submit handler that submitted before Editor.js serialized, prefill hidden description inputs from stored values, surface editor save failure; fixes 'Data cannot be empty' when only sub-categories changed
This commit is contained in:
1 parent
e95006a9e9
commit
c274e6dcd9
2 files changed
+6
-19
No files matched your search
@@ -256,14 +256,14 @@
|
||||
<div class="mb-10 fv-row">
|
||||
<label class="required form-label">Description</label>
|
||||
<div class="form-control" id="description" name="description"></div>
|
||||
<input type="hidden" id="description_input" name="description" />
|
||||
<input type="hidden" id="description_input" name="description" value="{{ $itemView->description }}" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-10 fv-row">
|
||||
<label class="required form-label">Description (EN)</label>
|
||||
<div class="form-control" id="description_en" name="description_en"></div>
|
||||
<input type="hidden" id="description_input_en" name="description_en" />
|
||||
<input type="hidden" id="description_input_en" name="description_en" value="{{ $itemView->description_en }}" />
|
||||
|
||||
</div>
|
||||
|
||||
@@ -315,13 +315,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", "#btn_submit", function(e) {
|
||||
e.preventDefault();
|
||||
alertLoading("Loading")
|
||||
const form = $('#frmUpdate');
|
||||
form.submit();
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -595,6 +588,7 @@
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error saving editor content:', error);
|
||||
alertFail('Notice', 'Could not save description, please try again');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user