Blur Event using JQUERY

When crusher is moved out by tag or Mouse is clicked else where then the blur event is triggered.
$(selector).blur()
While using focus event we have seen how to execute the code when the object is in focus, now we will develop a validation code to check if any date is entered or not. If user is moved out without entering any data then we will display the message.

Here is the code
<script>
$(document).ready(function() {
$('#t1').blur(function(){
var str1=$('#t1').val();
if(str1.length<1){
$('#d1').html('Please enter name');
}
});

$('#t2').blur(function(){
var str2=$('#t2').val();
if(str2.length<1){
$('#d1').html('Please enter email ');
}
});

})

</script>
Visitors Rating
Your Rating




Google+

Post Comment This is for short comments only. Use the forum for more discussions.







Most Popular JQuery Scripts

1

Two dependant list boxes

2

Calendar with Date Selection

3

Data change by Slider

4

Show & Hide element
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2018 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer