mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch 'submit_eventlistener' into 'master'
Submit eventlistener See merge request Chill-Projet/chill-bundles!171
This commit is contained in:
commit
cc7e38194f
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Submit button(s) are disabled as soon as submit button is clicked and form is submitted.
|
||||
* ID 'create-form' must be added to submit forms.
|
||||
*/
|
||||
|
||||
var form = document.getElementById('create-form');
|
||||
var submitButtons = document.querySelectorAll("[type=submit]");
|
||||
|
||||
form.addEventListener('submit', function(e){
|
||||
for(var i=0; i<submitButtons.length; i++){
|
||||
submitButtons[i].disabled = true;
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
@ -58,6 +58,7 @@ module.exports = function(encore, entries)
|
||||
encore.addEntry('mod_forkawesome', __dirname + '/Resources/public/module/forkawesome/index.js');
|
||||
encore.addEntry('mod_bootstrap', __dirname + '/Resources/public/module/bootstrap/index.js');
|
||||
encore.addEntry('mod_ckeditor5', __dirname + '/Resources/public/module/ckeditor5/index.js');
|
||||
encore.addEntry('mod_disablebuttons', __dirname + '/Resources/public/module/disable-buttons/index.js');
|
||||
|
||||
// Vue entrypoints
|
||||
encore.addEntry('vue_address', __dirname + '/Resources/public/vuejs/Address/index.js');
|
||||
|
@ -61,7 +61,7 @@
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_start(form, {'attr' : {'id' : 'create-form'}}) }}
|
||||
|
||||
|
||||
{{ form_row(form.lastName, { 'label' : 'Last name'|trans }) }}
|
||||
@ -104,3 +104,7 @@
|
||||
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block js %}
|
||||
{{ encore_entry_script_tags('mod_disablebuttons') }}
|
||||
{% endblock js %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user