Last active
November 21, 2016 21:38
-
-
Save activeprospect-support/6cf76a3cf4e6f5fad171 to your computer and use it in GitHub Desktop.
LC - Custom Script 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// overwrite whatever value is in a field | |
lead.program_of_interest = "Nursing Degree"; | |
// define a function, "isBlank()" | |
function isBlank(val) { | |
return !val || val == ''; | |
} | |
// define a function, "striphashcomma(str)" | |
function striphashcomma(str){ | |
return (str + '').replace(/([#]|[,]|[\?]|[\$]|[\&]|[\@]|[\'])/g, ""); | |
} | |
// strip non-alphanumeric characters out of a text field | |
if(!(isBlank(lead.city))){ | |
var ad = lead.city; | |
lead.city = striphashcomma(ad); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment