Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery validation on click

//html code
<input type="text" id="firstname">
<button onclick="myfunction()">click me</button>

//javascript function
myfunction(){
	//get value of element
	if(document.getElementById('firstname').value==''){
		alert() // if firstname is null, alert will popup.
	}
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #validation #click
ADD COMMENT
Topic
Name
9+1 =