html - validating using jquery in codeigniter -
<div class="label_left"><label>name :</label></div> <div class="text_right"><input type="text" name="usr_name" id="usr_name" value="" size="30" /><br /><br /></div> <div class="label_left"><label>title :</label></div> <div class="text_right"><input type="text" name="usr_title" id="usr_title" value="" size="30" /><br /><br /></div> <div class="label_left"><label>direct line :</label></div> <div class="text_right"><input type="text" name="usr_dline" id="usr_dline" value="" size="30" /><br /><br /></div> <div class="label_left"><label>e-mail :</label></div> <div class="text_right"><input type="text" name="usr_email" id="usr_email" value="" size="30" /><br /><br /></div> <div class="label_left"><label>organization :</label></div> <div class="text_right"><input type="text" name="usr_organization" id="usr_organization" value="" size="30" /><br /><br /></div>
i have code above. need check or validate above using jquery. can me example coding please.thanks
<script type="text/javascript"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> $(function(){ if($('#usr_name').val()==''){ alert('enter name!!!'); $('#usr_name').focus(); return false; } else if($('#usr_title').val()==''){ alert('enter title!!!'); $('#usr_title').focus(); return false; } ........................ ........................ ............. else{ return true; } }); </script>
this example jquery validation
Comments
Post a Comment