3

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.

  • Using what Column validation, c# or js? for C# and JS, use Regex. – Atish Dipongkor - MVP Dec 29 '15 at 9:17
  • This may help: sharepoint.stackexchange.com/questions/149106/… – P S Dec 29 '15 at 9:29
  • Do you want it in SharePoint list column? Which version of SharePoint are you using? – Hardik Dec 29 '15 at 10:04
  • Yes, I want in SharePoint 2013 list column.. I cannot use any scripts or queries as that has been prohibited.. – Yuges Dec 30 '15 at 1:11
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

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.