<commit_before>jQuery.dataformValidate
=======================

Validate a form based on data-validate html5 attributes.

<i><b>Note</b>: It will validate hidden fields, but <b>dataformValidate().valid</b> will return true if all visible elements are valid

<h3>JavaScript</h3>

Very simple to execute:

    $.('.myform').dataformValidate([options])
    
Simple use in an <b>if statement</b>:

    if (true === $.('.myform').dataformValidate([options]).valid){
        // do stuff here.
    }
    
Options are optional, and set automatically when given to the validator

    var options = {
        debug: false, // debug mode
        hightlightField: true, // do you want to highlight error input fields (ie. add the errorClass)
        errorClass: 'dataform-validate-error', // provide the class used for styling error input fields
        dateFormat: 'mdy' // provide in what format the date should be validated on.
    };
    
<h3>HTML</h3>

The HTML required data-validate="" attributes. The "parent" dom element should be given to the validator.

    <div class="myform">
        Required: <input type="text" data-validate="required" />
        Phonenumber: <input type="text" data-validate="phonenumber" />
        E-mail address: <input type="text" data-validate="email" />
        Minimum 4 character: <input type="text" data-validate="minlength=4" />
        Maximum 10 character: <input type="text" data-validate="maxlength=10" />
        Numeric: <input type="text" data-validate="numeric" />
        Date: <input type="text" data-validate="date" />
    </div>
    

    
<b>dateFormat</b> should only contain "m", "d" and/or "y" for validation. They represent month/day/year.

<h3>CSS</h3>

The only CSS required, is to highlight the fields. This is a simple, but effective example:

    .dataform-validate-error {
        background-color: #FAD7D7 !important;
          color: #858585 !important;
    	font-weight: bold !important;
    }<commit_msg>Update master<commit_after>jQuery.dataformValidate
=======================

Validate a form based on data-validate html5 attributes.

<i><b>Note</b>: It will validate hidden fields, but <b>dataformValidate().valid</b> will return true if all visible elements are valid

<h3>JavaScript</h3>

Very simple to execute:

    $.('.myform').dataformValidate([options])
    
Simple use in an <b>if statement</b>:

    if (true === $.('.myform').dataformValidate(options).valid){
        // do stuff here.
    }
    
Options are optional, and set automatically when given to the validator

    var options = {
        debug: false, // debug mode
        hightlightField: true, // do you want to highlight error input fields (ie. add the errorClass)
        errorClass: 'dataform-validate-error', // provide the class used for styling error input fields
        dateFormat: 'mdy' // provide in what format the date should be validated on.
    };
    
<h3>HTML</h3>

The HTML required data-validate="" attributes. The "parent" dom element should be given to the validator.

    <div class="myform">
        Required: <input type="text" data-validate="required" />
        Phonenumber: <input type="text" data-validate="phonenumber" />
        E-mail address: <input type="text" data-validate="email" />
        Minimum 4 character: <input type="text" data-validate="minlength=4" />
        Maximum 10 character: <input type="text" data-validate="maxlength=10" />
        Numeric: <input type="text" data-validate="numeric" />
        Date: <input type="text" data-validate="date" />
    </div>
    
Of course, any combination is valid. So this would also be possible:

    Required: <input type="text" data-validate="required minlength=4 maxlength=12 numeric" />
    
<b>dateFormat</b> should only contain "m", "d" and/or "y" for validation. They represent month/day/year.

<h3>CSS</h3>

The only CSS required, is to highlight the fields. This is a simple, but effective example:

    .dataform-validate-error {
        background-color: #FAD7D7 !important;
          color: #858585 !important;
    	font-weight: bold !important;
    }
{'fraction_non_alphanumeric': 0.13457303645705898, 'fraction_numerical': 0.011010521164668462, 'mean_word_length': 3.2627737226277373, 'pattern_counts': {'":': 0, '<': 52, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1232839', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1164, 'n_words': 400}