Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

validate form on submit

<script>
function validate(form) {

    // validation code here ...


    if(!valid) {
        alert('Please correct the errors in the form!');
        return false;
    }
    else {
        return confirm('Do you really want to submit the form?');
    }
}
</script>
<form onsubmit="return validate(this);">
Comment

PREVIOUS NEXT
Code Example
Javascript :: js search in object 
Javascript :: array of arrays to one array js 
Javascript :: html js how to draw on screen 
Javascript :: jquery close 
Javascript :: javascript delay some seconds 
Javascript :: react style css image 
Javascript :: express middleware pass parameter 
Javascript :: node assert 
Javascript :: getting values for metaboxes in wordpress 
Javascript :: ngif is string angular 
Javascript :: jquery option second 
Javascript :: how to code javascript 
Javascript :: populate example in mongoose 
Javascript :: jest add alias 
Javascript :: how to create react native app 
Javascript :: javascript escape newline 
Javascript :: Get the url and parse or url.parse deprecated solved 
Javascript :: how to import npm module 
Javascript :: divider in react native 
Javascript :: get url of page in background script 
Javascript :: how to add options to select in jquery array 
Javascript :: react enzyme 
Javascript :: cheerio 
Javascript :: npm install could not resolve peerDependencies 
Javascript :: express js hello world example 
Javascript :: angular http get status code 
Javascript :: how to cut off decimals in javascript 
Javascript :: SHOPIFY LANGUAGE SELECTOR 
Javascript :: how to use for of in javascript 
Javascript :: word randomizer 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =