5

I want to add phone number column with below format:

1-121-343-6917, 434-5503 & 60-12-444 444

Used below method

enter image description here enter image description here

=TEXT(123456 ,CHOOSE( LEN(123456) ,"0" ,"00" ,"000" ,"0-000" ,"00-000" ,"000-000" ,"0-000-000" ,"00-000-000" ,"000-000-000" ,"0-000-000-000"))

But this troublesome when you input information in EDIT mode rather than add NEW ITEM.

How I can use validation? Need help urgently.

4
  • Using what Column validation, c# or js? for C# and JS, use Regex. Commented Dec 29, 2015 at 9:17
  • This may help: sharepoint.stackexchange.com/questions/149106/… Commented Dec 29, 2015 at 9:29
  • Do you want it in SharePoint list column? Which version of SharePoint are you using? Commented Dec 29, 2015 at 10:04
  • Yes, I want in SharePoint 2013 list column.. I cannot use any scripts or queries as that has been prohibited.. Commented Dec 30, 2015 at 1:11

1 Answer 1

0

You can use regex and Jquery to validate for phone number field.

function ValidatePhone() { var phoneRegExp = /^((\+)?[1-9]{1,2})?([-\s\.])?((\(\d{1,4}\))|\d{1,4})(([-\s\.])?[0-9]{1,12}){1,2}$/; var phoneVal = $("#txtPhone").val(); var numbers = phoneVal.split("").lengthif (10 <= numbers && numbers <= 20 && phoneRegExp.test(phoneVal)) { alert("SUCCESS"); } } 

More reference: Phone number Validation using Jquery

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.