Thursday 18 February 2016

UK PHONE NUMBER VALIDATION JAVASCRIPT IN MS CRM 2015



                        



                      Add formatPhoneNumber function onChange Event of "your mobile attribute"

                      function formatPhoneNumber() {

                      var phoneNumber = Xrm.Page.getAttribute("new_mobile").getValue();
   
                     if (typeof (phoneNumber) != "undefined" && phoneNumber != null) {
                     if (phoneNumber.getValue() != null) {
                    var sTmp = phoneNumber.getValue().replace(/[^0-9]/g, "");
                   phoneNumber.setValue(sTmp.substr(0, 5) + " " + sTmp.substr(5, 6));
                    }
                 }
               }




No comments:

Post a Comment

Note: only a member of this blog may post a comment.