Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Demo: Add sample code for Bootstrap 4 usage#2173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Arkni merged 2 commits intojquery-validation:masterfromgwhenne:patch-1
Jun 20, 2018
Merged

Demo: Add sample code for Bootstrap 4 usage#2173

Arkni merged 2 commits intojquery-validation:masterfromgwhenne:patch-1
Jun 20, 2018

Conversation

gwhenne
Copy link
Contributor

Ref#2131.

Simple page showing how to use jquery-validation with Bootstrap 4.

Copy link
Member

@ArkniArkni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hi@gwhenne,

Thanks a lot for your contribution.

This looks good so far, however I left some comments in order to address some minor issues.

Also, do you think you can add an example with feedback icons like the one in Bootstrap v3 example?

<body>
<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

col-sm-offset-2 =>offset-sm-2

<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<div class="page-header">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

page-header =>border-bottom mb-4 mt-4 pb-2

},
errorElement: "em",
errorPlacement: function ( error, element ) {
// Add the `help-block` class to the error element
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

help-block =>invalid-feedback

error.addClass( "invalid-feedback" );

if ( element.prop( "type" ) === "checkbox" ) {
error.insertAfter( element.parent( "label" ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

element.parent( "label" ) =>element.next( "label" )

}
},
highlight: function ( element, errorClass, validClass ) {
$( element ).parents( ".col-sm-5" ).addClass( "is-invalid" ).removeClass( "is-valid" );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Remove.parents( ".col-sm-5" ), it's not needed here.

$( element ).parents( ".col-sm-5" ).addClass( "is-invalid" ).removeClass( "is-valid" );
},
unhighlight: function (element, errorClass, validClass) {
$( element ).parents( ".col-sm-5" ).addClass( "is-valid" ).removeClass( "is-invalid" );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Remove.parents( ".col-sm-5" ), it's not needed here.

<div class="form-check">
<label>
<input type="checkbox" id="agree" name="agree" value="agree" class="form-check-input"/>Please agree to our policy
</label>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Change this to:

<inputtype="checkbox"id="agree"name="agree"value="agree"class="form-check-input"/><labelclass="form-check-label">Please agree to our policy</label>

@gwhenne
Copy link
ContributorAuthor

@Arkni - I just uploaded code with your suggestions - thank you!

I didn't add Bootstrap 3 style feedback icons to the sample. Bs3 used Glyph icons to do this, which are not in Bs4.

Fromhttps://www.quackit.com/bootstrap/bootstrap_4/differences_between_bootstrap_3_and_bootstrap_4.cfm

Validation styles are not available for Bootstrap 4 forms. Use custom Bootstrap form validation messages instead.

Arkni reacted with hooray emoji

@Arkni
Copy link
Member

I applied the changes you pushed (found in branchpatch-2 in your fork)manually and pushed them to the branchpatch-1, because when you update the file using GitHub interface, it creates a new branch for each update, that's why I didn't see the changes here.

Thanks a lot for your contribution :)

@ArkniArkni merged commit349fc57 intojquery-validation:masterJun 20, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ArkniArkniArkni approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@gwhenne@Arkni

[8]ページ先頭

©2009-2025 Movatter.jp