CMTV
Well-known member
Hi!
I have a basic entity Add\Edit admin template with simple form in it:
How can I save entity and show "Your changes has been saved" flash message without page reload/redirection?
In other words, how can I do save process just like when editing existing templates in ACP?
I tried to add
I have a basic entity Add\Edit admin template with simple form in it:
HTML:
<!-- TITLE AND PAGE ACTIONS -->
<xf:form action="{{ link('phpc-criteria/save', $criterion) }}" ajax="true" class="block">
<div class="block-container">
<!-- FORM FIELDS HERE -->
<xf:submitrow sticky="true" icon="save" class="js-submitButton" data-ajax-redirect="{{ $criterion.isInsert() }}">
<xf:html>
<xf:button type="submit" name="exit" icon="save">{{ phrase('save_and_exit') }}</xf:button>
</xf:html>
</xf:submitrow>
</div>
<xf:redirect />
</xf:form>
How can I save entity and show "Your changes has been saved" flash message without page reload/redirection?
In other words, how can I do save process just like when editing existing templates in ACP?
I tried to add
class="js-submitButton"
and data-ajax-redirect
attributes but they do not work. The page is reloading after clicking "Save" or pressing "Ctrl + S".
Last edited: