Skullomania
Skullomania

Reputation: 2215

How do I use Bootstrap Validation?

I am new to Bootstrap Validation so what I did was copied the code from here and tried to get it to work in a JSFiddle. The issue that I am running into is that the validation that tells you only to select 2 choices does not show up here is what the tutorial suggested that I use:

<input type="checkbox"
name="qualityControl[]"
value="fast"
minchecked="2"
data-validation-minchecked-message="Choose two"
maxchecked="2"
data-validation-maxchecked-message=
"You can't have it all ways"
>

I did that and plugged in the submit JQuery and still get nothing when I select 3 also nothing turns yellow. I do get a cool popup identifier which tells me that I am close

Upvotes: 1

Views: 262

Answers (1)

melc
melc

Reputation: 11671

It is required to include jQuery and initialize jqBootstrapValidation i.e.

  $(function () { $("input,select,textarea").not("[type=submit]").jqBootstrapValidation(); } );

http://jsfiddle.net/7X9mG/2/

Upvotes: 2

Related Questions