Search This Blog

Friday, November 6, 2015

PreSaveAction Javascript validation in newform.aspx Page

Add the script editor webpart.


Add the below code:

 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js">

<script type="text/javascript">
function PreSaveAction(){
  var txtnumber = $('input[title="num_Phone"]').val();

   if (!isNaN(txtnumber)){      
   alert("Please enter a Number only");
$('input[title="num_Phone"]').focus();
   return false;
}

else{
   return true;
    }
 }
</script>

No comments:

Post a Comment