0

I am using SharePoint 2013. I just entered Mobile Number in Lists Library. But the mobile number entered is not in Validated Form.

I need to add mobile number with country code i.e. +(91)

Please help me out Guys to make validation for Mobile Number with Country Code. i.e +(91)xxx-xxxx-xxx

Example: +(91)987-6543-210.

0

Add content editor webpart in your new item page and add a script

<script language="javascript" src="https://code.jquery.com/jquery-1.12.2.js" type="text/javascript" ></script>
<script language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.maskedinput/1.4.1/jquery.maskedinput.js" type="text/javascript" ></script>
<script language="javascript" type="text/javascript">
jQuery(function($){
   $("input[title='Phone']").mask("+(99)999-9999-999");
});
</script>

It will validate number and only accept if number is in same format

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.