Skip to content

Exclude :submit from validation#144

Open
mark-31 wants to merge 1 commit into
nette:masterfrom
mark-31:patch-1
Open

Exclude :submit from validation#144
mark-31 wants to merge 1 commit into
nette:masterfrom
mark-31:patch-1

Conversation

@mark-31

@mark-31 mark-31 commented Feb 20, 2017

Copy link
Copy Markdown

Element :submit does not contain validation rules.

  • bug fix? yes
  • new feature? no
  • BC break? no

Element :submit does not contain validation rules.
@dg

dg commented Feb 20, 2017

Copy link
Copy Markdown
Member

Which bug it fixes?

@mark-31

mark-31 commented Feb 20, 2017

Copy link
Copy Markdown
Author

nette-live-form-validation + Bootstrap 3 + .input-group with submit button.
IMHO validation on submit is useless.

@dg

dg commented Feb 20, 2017

Copy link
Copy Markdown
Member

Where exactly is problem? Any side effect?

@mark-31

mark-31 commented Feb 20, 2017

Copy link
Copy Markdown
Author

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.

@Robyer

Robyer commented Mar 4, 2017

Copy link
Copy Markdown

@dg This PR was originally posted for nette-live-form-validation script ( contributte/live-form-validation#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).

@dg dg force-pushed the master branch 2 times, most recently from 571b36c to 841e5de Compare March 29, 2017 16:48
@dg

dg commented Jun 21, 2017

Copy link
Copy Markdown
Member

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.

@dg dg force-pushed the master branch 2 times, most recently from 21f7326 to 35f9b84 Compare March 9, 2020 10:42
@dg dg force-pushed the master branch 4 times, most recently from dc0cb8f to dd11397 Compare March 29, 2020 13:47
@dg dg added this to the v3.1 milestone Apr 20, 2020
@dg dg force-pushed the master branch 2 times, most recently from dd9d4ef to 458607d Compare May 15, 2020 10:07
@dg dg force-pushed the master branch 8 times, most recently from ec3633f to 206edb7 Compare June 6, 2020 15:14
@dg dg force-pushed the master branch 3 times, most recently from f305a97 to 215a482 Compare July 13, 2020 12:18
@dg dg force-pushed the master branch 3 times, most recently from 4c07b63 to f59c35e Compare July 31, 2020 18:03
@dg dg force-pushed the master branch 2 times, most recently from d5e7d21 to 6b69042 Compare October 15, 2020 20:02
@dg dg force-pushed the master branch 4 times, most recently from df91a09 to a358616 Compare November 2, 2020 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants