0

I have created a webform with telephone field, the submitted data is displayed in a views table, however the numbers in submitted data are in random format such as 1234567890, 234-987-9870, how do I configure the number field in views to be displayed in (123) 123 1234 format for the existing values and new submission.

2

1 Answer 1

0

If you are able to use Jquery here is a solution:

$('.phone').text(function(i, text) { return text.replace(/(\d\d\d)(\d\d\d)(\d\d\d\d)/, '$1-$2-$3'); });

http://jsfiddle.net/Xxk3F/1/

Answer found at: https://stackoverflow.com/questions/8760070/how-to-format-a-phone-number-with-jquery

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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