dist/js/FormValidation(.min).js
file.
dist/js/FormValidation.full(.min).js
file to your page.
FormValidation.validators
in browser if the page includes the
FormValidation.min.js
or
FormValidation.full.min.js
script.
<
script
src
=
"
/vendors/formvalidation/dist/js/FormValidation.min.js
"
>
script
>
<
script
>
document
.
addEventListener
(
'DOMContentLoaded'
,
function
(
e
)
{
// Now you can access the creditCard validator from
const
result
=
FormValidation
.
validators
.
creditCard
(
)
.
validate
(
{
value
:
'340653705597107'
,
options
:
{
message
:
'The credit card number is not valid'
,
}
,
}
)
;
// result.valid === true
// result.meta.type === 'AMERICAN_EXPRESS'
}
)
;
script
>
// You might need to change the importing path
import
creditCard
from
'formvalidation/dist/es6/validators/creditCard'
;
const
result
=
creditCard
(
)
.
validate
(
{
value
:
'340653705597107'
,
options
:
{
message
:
'The credit card number is not valid'
,
}
,
}
)
;
// result.valid === true
// result.meta.type === 'AMERICAN_EXPRESS'