Syntax

Platform.Function.IsPhoneNumber(value)
1 argument

Parameters

Name Type Required Description
value string Yes String to evaluate as a phone number

Examples

var phone = Platform.Request.GetFormField("phone");

if (!Platform.Function.IsPhoneNumber(phone)) {
    Write('<p class="error">Please enter a valid phone number.</p>');
} else {
    Platform.Function.UpsertData("Leads", ["Phone"], [phone], ["Source"], ["web"]);
}
function normalizeContact(raw) {
    if (!Platform.Function.IsPhoneNumber(raw.mobile)) {
        return { ok: false, msg: "Invalid mobile number" };
    }
    return { ok: true };
}

See Also