Can't make the validation work in Bootstrap 4
I'm trying to activate validation by Bootstrap and I've pasted in the follownig sample on my page.
<div class="form-group has-success">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control form-control-success" id="inputSuccess1">
<div class="form-control-feedback">Success! You've done it.</div>
<small class="form-text text-muted">Example help text that remains unchanged.</small>
</div>
I can see that the appearance of the input control has changed (it's a bit rounded and much more aesthetic now) but it still doesn't show the green border as can be seen on the page linked to. The Bootstrap I'm linking to is pointed out as follows.
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" />
Trying to googlearch the issue, I only arrive at examples linking to the official site from where I've got my sample, so there is rather little to help me there. I have a fiddle illustrating the issue.
What can I do about it? What am I missing?
html css twitter-bootstrap validation bootstrap-4
add a comment |
I'm trying to activate validation by Bootstrap and I've pasted in the follownig sample on my page.
<div class="form-group has-success">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control form-control-success" id="inputSuccess1">
<div class="form-control-feedback">Success! You've done it.</div>
<small class="form-text text-muted">Example help text that remains unchanged.</small>
</div>
I can see that the appearance of the input control has changed (it's a bit rounded and much more aesthetic now) but it still doesn't show the green border as can be seen on the page linked to. The Bootstrap I'm linking to is pointed out as follows.
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" />
Trying to googlearch the issue, I only arrive at examples linking to the official site from where I've got my sample, so there is rather little to help me there. I have a fiddle illustrating the issue.
What can I do about it? What am I missing?
html css twitter-bootstrap validation bootstrap-4
add a comment |
I'm trying to activate validation by Bootstrap and I've pasted in the follownig sample on my page.
<div class="form-group has-success">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control form-control-success" id="inputSuccess1">
<div class="form-control-feedback">Success! You've done it.</div>
<small class="form-text text-muted">Example help text that remains unchanged.</small>
</div>
I can see that the appearance of the input control has changed (it's a bit rounded and much more aesthetic now) but it still doesn't show the green border as can be seen on the page linked to. The Bootstrap I'm linking to is pointed out as follows.
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" />
Trying to googlearch the issue, I only arrive at examples linking to the official site from where I've got my sample, so there is rather little to help me there. I have a fiddle illustrating the issue.
What can I do about it? What am I missing?
html css twitter-bootstrap validation bootstrap-4
I'm trying to activate validation by Bootstrap and I've pasted in the follownig sample on my page.
<div class="form-group has-success">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control form-control-success" id="inputSuccess1">
<div class="form-control-feedback">Success! You've done it.</div>
<small class="form-text text-muted">Example help text that remains unchanged.</small>
</div>
I can see that the appearance of the input control has changed (it's a bit rounded and much more aesthetic now) but it still doesn't show the green border as can be seen on the page linked to. The Bootstrap I'm linking to is pointed out as follows.
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" />
Trying to googlearch the issue, I only arrive at examples linking to the official site from where I've got my sample, so there is rather little to help me there. I have a fiddle illustrating the issue.
What can I do about it? What am I missing?
html css twitter-bootstrap validation bootstrap-4
html css twitter-bootstrap validation bootstrap-4
asked Aug 29 '17 at 12:04
user1675891
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Validation has changed as of the Bootstrap 4 beta release.
The valid state selectors use the was-validated
class which would be added dynamically after validating the form via client-side JavaScript. For example...
<form class="container was-validated" novalidate="">
<div class="form-group">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control" name="i1" id="inputSuccess1">
<div class="valid-feedback">Success! You've done it.</div>
</div>
<div class="form-group">
<label class="form-control-label" for="inputSuccess2">Input with danger</label>
<input type="text" class="form-control" name="i2" required="" id="inputSuccess2">
<div class="invalid-feedback">That didn't work.</div>
</div>
<div class="">
<button type="submit" class="btn btn-secondary">Text</button>
</div>
</form>
https://www.codeply.com/go/45rU7UOhFo
Update 2018 - Bootstrap 4.0.0
Form Validation Example Demo
As explained in the docs, if you intend to use server-side validation you can simply set the is-valid
or is-invalid
classes on the form-controls...
<form class="container">
<div class="form-group">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control is-valid" id="inputSuccess1">
<div class="valid-feedback">Success! You've done it.</div>
</div>
</form>
hello,I'm browsingbootstrap's validation docsand I couldn´t make client-side validation work,until I noticed (inspector) there is a script in that docs page,which is the one making it work,I mean aside from the cores bootstrap.js and jquery.js,indeed when I added it to my project,it worked.Is that actually the way?do I actually need to manually add that chunk of code,cause I´m telling you,it won´t work without it,not in my project,nor in the docs.I can´t post the script here but it´s in the docs I linked,right after the form tag
– Scaramouche
Oct 16 '18 at 1:27
Can’t believe how hard this was to find. The docs don’t make clear at all that you need a small event handler to add the class («you may choose when to activate them (typically after form submission is attempted)»). Thanks for the answer!
– Éric Araujo
Feb 1 at 3:25
add a comment |
It appears the validation changes again in the final release version of Bootstrap 4: http://getbootstrap.com/docs/4.0/components/forms/#validation.
It becomes more complicated than I thought.
Custom style client side validation is recommended:
- When validated, the form adds a class named
was-validated
. - Feedback messages are wrapped within
.valid-feedback
or.invalid-feedback
.
For server-side validation:
- No need for
was-validated
class on the<form>
tag. - Add
.is-valid
or.is-invalid
on the input control. - Add
.invalid-feedback
or.valid-feedback
for the feedback message.
2
I don't think the form needs to have needs-validation class, this is just on the bootstrap doc but doesn't do anything.
– Tonio
Feb 15 '18 at 15:19
Saying "No need forwas-validated
" isn't really sufficient. I'd say, "do not addwas-validated
if you want the server-side validation to work... You can't use both together. Either you use client-side withwas-validated
or you useis-invalid
/is-valid
by adding it from server side code.
– Eric Milliot-Martinez
Apr 27 '18 at 17:38
Note that as per example code in the document (scroll to the bottom of the code blob) the client-side Javascript needs to add thewas-validated
class upon form submission! Otherwise, nothing will show!
– Jens
Dec 14 '18 at 6:38
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45938703%2fcant-make-the-validation-work-in-bootstrap-4%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Validation has changed as of the Bootstrap 4 beta release.
The valid state selectors use the was-validated
class which would be added dynamically after validating the form via client-side JavaScript. For example...
<form class="container was-validated" novalidate="">
<div class="form-group">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control" name="i1" id="inputSuccess1">
<div class="valid-feedback">Success! You've done it.</div>
</div>
<div class="form-group">
<label class="form-control-label" for="inputSuccess2">Input with danger</label>
<input type="text" class="form-control" name="i2" required="" id="inputSuccess2">
<div class="invalid-feedback">That didn't work.</div>
</div>
<div class="">
<button type="submit" class="btn btn-secondary">Text</button>
</div>
</form>
https://www.codeply.com/go/45rU7UOhFo
Update 2018 - Bootstrap 4.0.0
Form Validation Example Demo
As explained in the docs, if you intend to use server-side validation you can simply set the is-valid
or is-invalid
classes on the form-controls...
<form class="container">
<div class="form-group">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control is-valid" id="inputSuccess1">
<div class="valid-feedback">Success! You've done it.</div>
</div>
</form>
hello,I'm browsingbootstrap's validation docsand I couldn´t make client-side validation work,until I noticed (inspector) there is a script in that docs page,which is the one making it work,I mean aside from the cores bootstrap.js and jquery.js,indeed when I added it to my project,it worked.Is that actually the way?do I actually need to manually add that chunk of code,cause I´m telling you,it won´t work without it,not in my project,nor in the docs.I can´t post the script here but it´s in the docs I linked,right after the form tag
– Scaramouche
Oct 16 '18 at 1:27
Can’t believe how hard this was to find. The docs don’t make clear at all that you need a small event handler to add the class («you may choose when to activate them (typically after form submission is attempted)»). Thanks for the answer!
– Éric Araujo
Feb 1 at 3:25
add a comment |
Validation has changed as of the Bootstrap 4 beta release.
The valid state selectors use the was-validated
class which would be added dynamically after validating the form via client-side JavaScript. For example...
<form class="container was-validated" novalidate="">
<div class="form-group">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control" name="i1" id="inputSuccess1">
<div class="valid-feedback">Success! You've done it.</div>
</div>
<div class="form-group">
<label class="form-control-label" for="inputSuccess2">Input with danger</label>
<input type="text" class="form-control" name="i2" required="" id="inputSuccess2">
<div class="invalid-feedback">That didn't work.</div>
</div>
<div class="">
<button type="submit" class="btn btn-secondary">Text</button>
</div>
</form>
https://www.codeply.com/go/45rU7UOhFo
Update 2018 - Bootstrap 4.0.0
Form Validation Example Demo
As explained in the docs, if you intend to use server-side validation you can simply set the is-valid
or is-invalid
classes on the form-controls...
<form class="container">
<div class="form-group">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control is-valid" id="inputSuccess1">
<div class="valid-feedback">Success! You've done it.</div>
</div>
</form>
hello,I'm browsingbootstrap's validation docsand I couldn´t make client-side validation work,until I noticed (inspector) there is a script in that docs page,which is the one making it work,I mean aside from the cores bootstrap.js and jquery.js,indeed when I added it to my project,it worked.Is that actually the way?do I actually need to manually add that chunk of code,cause I´m telling you,it won´t work without it,not in my project,nor in the docs.I can´t post the script here but it´s in the docs I linked,right after the form tag
– Scaramouche
Oct 16 '18 at 1:27
Can’t believe how hard this was to find. The docs don’t make clear at all that you need a small event handler to add the class («you may choose when to activate them (typically after form submission is attempted)»). Thanks for the answer!
– Éric Araujo
Feb 1 at 3:25
add a comment |
Validation has changed as of the Bootstrap 4 beta release.
The valid state selectors use the was-validated
class which would be added dynamically after validating the form via client-side JavaScript. For example...
<form class="container was-validated" novalidate="">
<div class="form-group">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control" name="i1" id="inputSuccess1">
<div class="valid-feedback">Success! You've done it.</div>
</div>
<div class="form-group">
<label class="form-control-label" for="inputSuccess2">Input with danger</label>
<input type="text" class="form-control" name="i2" required="" id="inputSuccess2">
<div class="invalid-feedback">That didn't work.</div>
</div>
<div class="">
<button type="submit" class="btn btn-secondary">Text</button>
</div>
</form>
https://www.codeply.com/go/45rU7UOhFo
Update 2018 - Bootstrap 4.0.0
Form Validation Example Demo
As explained in the docs, if you intend to use server-side validation you can simply set the is-valid
or is-invalid
classes on the form-controls...
<form class="container">
<div class="form-group">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control is-valid" id="inputSuccess1">
<div class="valid-feedback">Success! You've done it.</div>
</div>
</form>
Validation has changed as of the Bootstrap 4 beta release.
The valid state selectors use the was-validated
class which would be added dynamically after validating the form via client-side JavaScript. For example...
<form class="container was-validated" novalidate="">
<div class="form-group">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control" name="i1" id="inputSuccess1">
<div class="valid-feedback">Success! You've done it.</div>
</div>
<div class="form-group">
<label class="form-control-label" for="inputSuccess2">Input with danger</label>
<input type="text" class="form-control" name="i2" required="" id="inputSuccess2">
<div class="invalid-feedback">That didn't work.</div>
</div>
<div class="">
<button type="submit" class="btn btn-secondary">Text</button>
</div>
</form>
https://www.codeply.com/go/45rU7UOhFo
Update 2018 - Bootstrap 4.0.0
Form Validation Example Demo
As explained in the docs, if you intend to use server-side validation you can simply set the is-valid
or is-invalid
classes on the form-controls...
<form class="container">
<div class="form-group">
<label class="form-control-label" for="inputSuccess1">Input with success</label>
<input type="text" class="form-control is-valid" id="inputSuccess1">
<div class="valid-feedback">Success! You've done it.</div>
</div>
</form>
edited Feb 28 '18 at 11:38
answered Aug 29 '17 at 12:15
ZimZim
196k51413395
196k51413395
hello,I'm browsingbootstrap's validation docsand I couldn´t make client-side validation work,until I noticed (inspector) there is a script in that docs page,which is the one making it work,I mean aside from the cores bootstrap.js and jquery.js,indeed when I added it to my project,it worked.Is that actually the way?do I actually need to manually add that chunk of code,cause I´m telling you,it won´t work without it,not in my project,nor in the docs.I can´t post the script here but it´s in the docs I linked,right after the form tag
– Scaramouche
Oct 16 '18 at 1:27
Can’t believe how hard this was to find. The docs don’t make clear at all that you need a small event handler to add the class («you may choose when to activate them (typically after form submission is attempted)»). Thanks for the answer!
– Éric Araujo
Feb 1 at 3:25
add a comment |
hello,I'm browsingbootstrap's validation docsand I couldn´t make client-side validation work,until I noticed (inspector) there is a script in that docs page,which is the one making it work,I mean aside from the cores bootstrap.js and jquery.js,indeed when I added it to my project,it worked.Is that actually the way?do I actually need to manually add that chunk of code,cause I´m telling you,it won´t work without it,not in my project,nor in the docs.I can´t post the script here but it´s in the docs I linked,right after the form tag
– Scaramouche
Oct 16 '18 at 1:27
Can’t believe how hard this was to find. The docs don’t make clear at all that you need a small event handler to add the class («you may choose when to activate them (typically after form submission is attempted)»). Thanks for the answer!
– Éric Araujo
Feb 1 at 3:25
hello,I'm browsingbootstrap's validation docsand I couldn´t make client-side validation work,until I noticed (inspector) there is a script in that docs page,which is the one making it work,I mean aside from the cores bootstrap.js and jquery.js,indeed when I added it to my project,it worked.Is that actually the way?do I actually need to manually add that chunk of code,cause I´m telling you,it won´t work without it,not in my project,nor in the docs.I can´t post the script here but it´s in the docs I linked,right after the form tag
– Scaramouche
Oct 16 '18 at 1:27
hello,I'm browsingbootstrap's validation docsand I couldn´t make client-side validation work,until I noticed (inspector) there is a script in that docs page,which is the one making it work,I mean aside from the cores bootstrap.js and jquery.js,indeed when I added it to my project,it worked.Is that actually the way?do I actually need to manually add that chunk of code,cause I´m telling you,it won´t work without it,not in my project,nor in the docs.I can´t post the script here but it´s in the docs I linked,right after the form tag
– Scaramouche
Oct 16 '18 at 1:27
Can’t believe how hard this was to find. The docs don’t make clear at all that you need a small event handler to add the class («you may choose when to activate them (typically after form submission is attempted)»). Thanks for the answer!
– Éric Araujo
Feb 1 at 3:25
Can’t believe how hard this was to find. The docs don’t make clear at all that you need a small event handler to add the class («you may choose when to activate them (typically after form submission is attempted)»). Thanks for the answer!
– Éric Araujo
Feb 1 at 3:25
add a comment |
It appears the validation changes again in the final release version of Bootstrap 4: http://getbootstrap.com/docs/4.0/components/forms/#validation.
It becomes more complicated than I thought.
Custom style client side validation is recommended:
- When validated, the form adds a class named
was-validated
. - Feedback messages are wrapped within
.valid-feedback
or.invalid-feedback
.
For server-side validation:
- No need for
was-validated
class on the<form>
tag. - Add
.is-valid
or.is-invalid
on the input control. - Add
.invalid-feedback
or.valid-feedback
for the feedback message.
2
I don't think the form needs to have needs-validation class, this is just on the bootstrap doc but doesn't do anything.
– Tonio
Feb 15 '18 at 15:19
Saying "No need forwas-validated
" isn't really sufficient. I'd say, "do not addwas-validated
if you want the server-side validation to work... You can't use both together. Either you use client-side withwas-validated
or you useis-invalid
/is-valid
by adding it from server side code.
– Eric Milliot-Martinez
Apr 27 '18 at 17:38
Note that as per example code in the document (scroll to the bottom of the code blob) the client-side Javascript needs to add thewas-validated
class upon form submission! Otherwise, nothing will show!
– Jens
Dec 14 '18 at 6:38
add a comment |
It appears the validation changes again in the final release version of Bootstrap 4: http://getbootstrap.com/docs/4.0/components/forms/#validation.
It becomes more complicated than I thought.
Custom style client side validation is recommended:
- When validated, the form adds a class named
was-validated
. - Feedback messages are wrapped within
.valid-feedback
or.invalid-feedback
.
For server-side validation:
- No need for
was-validated
class on the<form>
tag. - Add
.is-valid
or.is-invalid
on the input control. - Add
.invalid-feedback
or.valid-feedback
for the feedback message.
2
I don't think the form needs to have needs-validation class, this is just on the bootstrap doc but doesn't do anything.
– Tonio
Feb 15 '18 at 15:19
Saying "No need forwas-validated
" isn't really sufficient. I'd say, "do not addwas-validated
if you want the server-side validation to work... You can't use both together. Either you use client-side withwas-validated
or you useis-invalid
/is-valid
by adding it from server side code.
– Eric Milliot-Martinez
Apr 27 '18 at 17:38
Note that as per example code in the document (scroll to the bottom of the code blob) the client-side Javascript needs to add thewas-validated
class upon form submission! Otherwise, nothing will show!
– Jens
Dec 14 '18 at 6:38
add a comment |
It appears the validation changes again in the final release version of Bootstrap 4: http://getbootstrap.com/docs/4.0/components/forms/#validation.
It becomes more complicated than I thought.
Custom style client side validation is recommended:
- When validated, the form adds a class named
was-validated
. - Feedback messages are wrapped within
.valid-feedback
or.invalid-feedback
.
For server-side validation:
- No need for
was-validated
class on the<form>
tag. - Add
.is-valid
or.is-invalid
on the input control. - Add
.invalid-feedback
or.valid-feedback
for the feedback message.
It appears the validation changes again in the final release version of Bootstrap 4: http://getbootstrap.com/docs/4.0/components/forms/#validation.
It becomes more complicated than I thought.
Custom style client side validation is recommended:
- When validated, the form adds a class named
was-validated
. - Feedback messages are wrapped within
.valid-feedback
or.invalid-feedback
.
For server-side validation:
- No need for
was-validated
class on the<form>
tag. - Add
.is-valid
or.is-invalid
on the input control. - Add
.invalid-feedback
or.valid-feedback
for the feedback message.
edited Nov 26 '18 at 6:12
Adriano
1,38811527
1,38811527
answered Feb 6 '18 at 14:37
BlaiseBlaise
8,9771778139
8,9771778139
2
I don't think the form needs to have needs-validation class, this is just on the bootstrap doc but doesn't do anything.
– Tonio
Feb 15 '18 at 15:19
Saying "No need forwas-validated
" isn't really sufficient. I'd say, "do not addwas-validated
if you want the server-side validation to work... You can't use both together. Either you use client-side withwas-validated
or you useis-invalid
/is-valid
by adding it from server side code.
– Eric Milliot-Martinez
Apr 27 '18 at 17:38
Note that as per example code in the document (scroll to the bottom of the code blob) the client-side Javascript needs to add thewas-validated
class upon form submission! Otherwise, nothing will show!
– Jens
Dec 14 '18 at 6:38
add a comment |
2
I don't think the form needs to have needs-validation class, this is just on the bootstrap doc but doesn't do anything.
– Tonio
Feb 15 '18 at 15:19
Saying "No need forwas-validated
" isn't really sufficient. I'd say, "do not addwas-validated
if you want the server-side validation to work... You can't use both together. Either you use client-side withwas-validated
or you useis-invalid
/is-valid
by adding it from server side code.
– Eric Milliot-Martinez
Apr 27 '18 at 17:38
Note that as per example code in the document (scroll to the bottom of the code blob) the client-side Javascript needs to add thewas-validated
class upon form submission! Otherwise, nothing will show!
– Jens
Dec 14 '18 at 6:38
2
2
I don't think the form needs to have needs-validation class, this is just on the bootstrap doc but doesn't do anything.
– Tonio
Feb 15 '18 at 15:19
I don't think the form needs to have needs-validation class, this is just on the bootstrap doc but doesn't do anything.
– Tonio
Feb 15 '18 at 15:19
Saying "No need for
was-validated
" isn't really sufficient. I'd say, "do not add was-validated
if you want the server-side validation to work... You can't use both together. Either you use client-side with was-validated
or you use is-invalid
/is-valid
by adding it from server side code.– Eric Milliot-Martinez
Apr 27 '18 at 17:38
Saying "No need for
was-validated
" isn't really sufficient. I'd say, "do not add was-validated
if you want the server-side validation to work... You can't use both together. Either you use client-side with was-validated
or you use is-invalid
/is-valid
by adding it from server side code.– Eric Milliot-Martinez
Apr 27 '18 at 17:38
Note that as per example code in the document (scroll to the bottom of the code blob) the client-side Javascript needs to add the
was-validated
class upon form submission! Otherwise, nothing will show!– Jens
Dec 14 '18 at 6:38
Note that as per example code in the document (scroll to the bottom of the code blob) the client-side Javascript needs to add the
was-validated
class upon form submission! Otherwise, nothing will show!– Jens
Dec 14 '18 at 6:38
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45938703%2fcant-make-the-validation-work-in-bootstrap-4%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown