Getting Started

isPluginEnabled() method

Check if a particular plugin is enabled
            
isPluginEnabled ( name : String ) : boolean
If the plugin hasn't been registered yet, then the method returns false .
(* denotes a required parameter)
Parameter Type Description
name * String The plugin name
Using the global script in the browser
            
const fv = FormValidation . formValidation (
document . getElementById ( 'demoForm' ) ,
{
fields : {
...
} ,
plugins : {
wizard : new FormValidation . plugins . Wizard ( {
...
} ) ,
}
}
) ;
// Check if the Wizard plugin is enabled
fv . isPluginEnabled ( 'wizard' ) ;
Using the ES6 module
            
import { formValidation } from '/path/to/-validation/esm/bundle/popular' ;
import { Wizard } from '/path/to/-validation/esm/plugin-wizard' ;
const fv = formValidation (
document . getElementById ( 'demoForm' ) ,
{
fields : {
...
} ,
plugins : {
wizard : new Wizard ( {
...
} ) ,
}
}
) ;
// Check if the Wizard plugin is enabled
fv . isPluginEnabled ( 'wizard' ) ;
Using the npm package
            
import { formValidation } from '-validation/bundle/popular' ;
import { Wizard } from '-validation/plugin-wizard' ;
const fv = formValidation (
document . getElementById ( 'demoForm' ) ,
{
fields : {
...
} ,
plugins : {
wizard : new Wizard ( {
...
} ) ,
}
}
) ;
// Check if the Wizard plugin is enabled
fv . isPluginEnabled ( 'wizard' ) ;