Please I need your help, I want to disable a button on click and submit my form this is the code
{{ form_start(form, {'attr': {'id': 'myForm'}}) }}
//....... NOT important
{{ form_rest(form) }}
<button class="btn-large waves-effect waves-light fullwidth" type="submit" id="monBttn" onclick="myFunction()" name="action"
value="{{ 'registration.submit'|trans({}, 'FOSUserBundle') }}">
<i class="material-icons left">save</i>
Enregistrer
</button>
{{ form_end(form) }}
In my button i called a fuction this is the code
<script>
function myFunction() {
buttn = document.getElementById("monBttn");
document.getElementById("myForm").submit();
buttn.setAttribute('disabled','disabled');
}
</script>
my script does not work the button is disabled but it does'nt submit the value Thanks in advance :)