I am trying to combine Text and a Text Box with a phone number but keeping the phone number format.
I am using
event.value = "If you have any questions, please do not hesitate to call me at " + this.getField("Phone Number").value + ".";
But the Phone Number does not keep it's formatting.
Any Assistance would be greatly appreciated.
Copy link to clipboard
Thats because it uses value you enter in a phone field, what you see in that field is just formatting.
In your calculation you can set format using 'printx', like this:
var f = this.getField("Phone Number");
var nFormat = util.printx("999 999-9999", f.valueAsString);
event.value = "If you have any questions, please do not hesitate to call me at " + nFormat + ".";
event.value = "";
Change "999 999-9999" to the format you want.
That worked great. Thank you very much!