const
fv
=
FormValidation
.
formValidation
(
document
.
getElementById
(
'demoForm'
)
,
{
fields
:
{
...
}
,
plugins
:
{
...
icon
:
new
FormValidation
.
plugins
.
Icon
(
{
valid
:
'fa fa-check'
,
invalid
:
'fa fa-times'
,
validating
:
'fa fa-refresh'
,
onPlaced
:
function
(
e
)
{
// e.field is the field name
// e.iconElement presents the icon element
e
.
iconElement
.
addEventListener
(
'click'
,
function
(
)
{
// Reset field when clicking on the associated icon
fv
.
resetField
(
e
.
field
)
;
}
)
;
}
,
}
)
,
}
,
}
)
;