Copy link to clipboard
Copied
Good Afternoon,
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.
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);
if(f.value)
event.value = "If you have any questions, please do not hesitate to call me at " + nFormat + ".";
else
event.value = "";
Change "999 999-9999" to the format you want.
Copy link to clipboard
Copied
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);
if(f.value)
event.value = "If you have any questions, please do not hesitate to call me at " + nFormat + ".";
else
event.value = "";
Change "999 999-9999" to the format you want.
Copy link to clipboard
Copied
That worked great. Thank you very much!