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

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -