Namespace: .htmlInterface

vivalid. .htmlInterface

The interface to use when using data attributes to define Inputs And Groups.
Source:

Methods

(static) addCallback(name, fn)

Adds functional parameters, to be referenced at html data attributes.
Parameters:
Name Type Description
name string
fn function
Source:
Example
vivalid.htmlInterface.addCallback('onValidationFailure', function(invalid,pending,valid){ alert('input group is invalid!: '+invalid+ ' invalid, ' +pending+' pending, and ' +valid+' valid ' ); });

(static) initAll()

Bootstraps all groups when using the html data attributes interface. Will work on all groups present at initial page load.
Source:
Example
vivalid.htmlInterface.initAll();

(static) initGroup(groupElem)

Bootstraps a group by the group's DOM HTMLElement when using the html data attributes interface. Provides more control over vivalid.htmlInterface.init. Usefull when some of the elements are not present when DOMContentLoaded fires, but rather are appended at some later stage in the application flow.
Parameters:
Name Type Description
groupElem HTMLElement
Source:
Example
vivalid.htmlInterface.initGroup(document.getElementById('FormId'));

(static) resetGroup(groupName)

Allow's an application to reset the validations state and event listeners of a group
Parameters:
Name Type Description
groupName string
Source:
Example
vivalid.htmlInterface.resetGroup('contactGroup');