This is my javascript

```
<script>

    $('#submitform').submit(function() {
        if ($(this).find('.input-validation-error').length == 0) {
            $(this).find('button').prop('disabled', true);
        } else {
            $(this).find('button').prop('disabled', false);
            }
    });

</script>

```

the problem is when I submit and I have validation errors like required field, button submit are disabled so I need to reload page to enable button again... Why else loop don't works correctly?