backoffice: apply form js to quick form preview (#53628)

This commit is contained in:
Frédéric Péters 2021-04-30 15:44:51 +02:00
parent 16ef227eb0
commit 9e8c88ce07
2 changed files with 2 additions and 1 deletions

View File

@ -1138,6 +1138,7 @@ class FormDefPage(Directory):
def get_preview(self):
form = Form(action='#', use_tokens=False)
form.attrs['data-backoffice-preview'] = 'on'
on_page = 0
for i, field in enumerate(self.formdef.fields):
field.id = i

View File

@ -335,7 +335,7 @@ $(function() {
}
add_js_behaviours($('form[data-live-url]'));
add_js_behaviours($('form[data-live-url], form[data-backoffice-preview]'));
// Form with error
const first_widget_with_error = document.querySelector('.widget-with-error');