Exclude :submit from validation
Element :submit does not contain validation rules.
- bug fix? yes
- new feature? no
- BC break? no
Which bug it fixes?
nette-live-form-validation + Bootstrap 3 + .input-group with submit button. IMHO validation on submit is useless.
Where exactly is problem? Any side effect?
Example:
<div class="form-group">
<div class="input-group">
{input login-password, class => 'form-control'}
<div class="input-group-btn">
<button n:name="submitter-signin" class="btn btn-primary no-live-validation" type="submit">
<i class="fa fa-sign-in"></i>
</button>
</div>
</div>
</div>
Class .form-group is parental element for 2 controls. If input:text is empty, parental element has to have class .has-error, but result is adverse, because the submitter is always positive.
@dg This PR was originally posted for nette-live-form-validation script ( https://github.com/Robyer/nette-live-form-validation/pull/30 ).
Is there a reason why submit is not ignored (as this PR proposes)? Or you don't want to merge this just because it doesn't make any real change for netteForms.js itself? I haven't used nette for a while so I can't really tell what side-effects this could cause (if any).
I understand what the problem is. The same thing can happen if two inputs are together in one form-group, so a better solution is the error state only to turn on, not to turn off.