Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

html form pattern message

input.oninvalid = function(event) {
    event.target.setCustomValidity('Username should only contain lowercase letters. e.g. john');
}
Comment

html form pattern message

input.addEventListener('invalid', function(event){
    event.preventDefault();
    if ( ! event.target.validity.valid ) {
        elem.textContent   = 'Username should only contain lowercase letters e.g. john';
        elem.className     = 'error';
        elem.style.display = 'block';
 
        input.className    = 'invalid animated shake';
    }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript persistent storage 
Javascript :: jquery ajax endpoint 
Javascript :: jquery find child of parent sibling 
Javascript :: generate random color jquery 
Javascript :: moment js convert to local timezone 
Javascript :: injected stylesheet remove 
Javascript :: js order alphabetically 
Javascript :: js union arrays 
Javascript :: comparing two lists in javascript 
Javascript :: javascript check date greater than today 
Javascript :: how to remove a part of a string javascript 
Javascript :: remove after js 
Javascript :: dropzone add download button 
Javascript :: redirect javascript code 
Javascript :: redirect with javascript to another page 
Javascript :: js get distinct values from array 
Javascript :: checking a point is in polygon 
Javascript :: java superscript numbers 
Javascript :: js get file content from url 
Javascript :: how to access model data in jsp spring mvc 
Javascript :: remove space from string javascript 
Javascript :: check if string is valid date 
Javascript :: localstorage save array 
Javascript :: how to right rotate an array in JS 
Javascript :: set a previous year to the current date in javascript 
Javascript :: fetchData from json file 
Javascript :: express search query template 
Javascript :: pagination jsonplaceholder 
Javascript :: function use for placing bet 
Javascript :: push state array react 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =