Skip to content

Instantly share code, notes, and snippets.

@activeprospect-support
Last active November 21, 2016 21:38
Show Gist options
  • Save activeprospect-support/6cf76a3cf4e6f5fad171 to your computer and use it in GitHub Desktop.
Save activeprospect-support/6cf76a3cf4e6f5fad171 to your computer and use it in GitHub Desktop.
LC - Custom Script 2
// 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