Duplicated Leads

Maxwell_Obeng-Y
Level 1

Duplicated Leads

Hi, I'm hoping someone can tell me if the following code could be the reason why our form would be firing twice and creating duplicate records in our instance? We implemented this a couple of months back on our BounceX pages. I'm trying to pin down what is causing duplicated leads through these forms. Thanks.

MktoForms2.loadForm("//app-abXX.marketo.com", "XXX-XXX-XXX", XXXX, function(form) {
form.onSubmit(function(){
var sEmail = form.vals().Email;
var chunks = sEmail.split('@');
var emaildomain = chunks[1];
form.vals({"Email":sEmail.toLowerCase(),"acbj_emailDomain__c":emaildomain.toLowerCase()});
});
});‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: Duplicated Leads

Please highlight your code using the Advanced Editor's syntax highlighter and include a link to an example page so other code can be inspected.

Then we'll continue.

Maxwell_Obeng-Y
Level 1

Re: Duplicated Leads

Sure, thanks.

SanfordWhiteman
Level 10 - Community Moderator

Re: Duplicated Leads

There's no reason for that code alone to cause duplicates.  Please link to an example page.

(I would caution that you should be using toLocaleLowerCase(), or better yet not changing the case of the mailbox/left-hand-side at all.)

Maxwell_Obeng-Y
Level 1

Re: Duplicated Leads

Sure, thanks.

SanfordWhiteman
Level 10 - Community Moderator

Re: Duplicated Leads

So where's the link?

Maxwell_Obeng-Y
Level 1

Re: Duplicated Leads

Took it down, having spambot issues. Planing on integrating google reCAPTCHA tomorrow. thanks!

Have the code ready, will let you know.

Thanks.