0

There's this lead form on my website, which is integrated with zoho CRM.

What i do is make an ajax form submit. It works perfectly in all the browsers except Internet Explorer.

Here's the code that I am using :

$.ajax({
                    type: 'POST',
                    url: 'https://crm.zoho.com/crm/WebToLeadForm',
                    crossDomain: true,
                    data: {
                        "xnQsjsdp":"ppmcCsqovwVthYo*kRl79w$$", 
                        "xmIwtLD":"VhOb6HhGDim4uPu3Iakv-bchDcGQB5gh", 
                        "actionType":"TGVhZHM=", 
                        "returnURL": "http://www.taxday.co.uk/", 
                        "First Name":$("#contact-name").val(),
                        "Last Name":$("#contact-subject").val(), 
                        "Phone":$("#contact-home-number").val(), 
                        "Email":$("#contact-email").val(),
                        "Description" : $("#contact-message").val(),
                        "LEADCF1":prof,
                        "Street" : $("#contact-address").val(),
                        "Zip Code" : $("#contact-postcode").val()
                    },
                    dataType: 'json',
                    success: function(responseData, textStatus, jqXHR) {
                       alert("Form Submitted");
                    },
                    error: function (responseData, textStatus, errorThrown) {
                       alert("Form Submitted");
                    }
                });

But the deal alert comes in IE but the lead is not captured at zoho end

Any help would be much appreciated.

Thanks

Sushil
  • 39
  • 1
  • 7

1 Answers1

1

For cross-domain, IE requires you to use XDomainRequest instead of XMLHttpRequest. jQuery doesn't do it so you have to do it manually:

    if ($.browser.msie && window.XDomainRequest) {
        // Use Microsoft XDR
        var xdr = new XDomainRequest();
        xdr.open("get", url);
        xdr.onload = function() {
            // XDomainRequest doesn't provide responseXml, so if you need it:
            var dom = new ActiveXObject("Microsoft.XMLDOM");
            dom.async = false;
            dom.loadXML(xdr.responseText);
        };
        xdr.send();
    } else {
        $.ajax({...});
    }

Please refer the below forum thread of JQUERY

http://forum.jquery.com/topic/cross-domain-ajax-and-ie

and also the same question is asked in stack over flow

Jquery $.ajax fails in IE on cross domain calls

Regards Mahesh, Zoho CRM.

Community
  • 1
  • 1