jQuery - send data when click

0 votes
79 views
added Aug 7, 2019 in jQuery by lcjr First Warrant Officer (9,190 points)
$("#send").click(function (e) {
    e.preventDefault();
    // get data
    var title = window.listingTitle;
    var nid = window.listingNid;
    var type = window.listingType;
    var agt_phone = $('#agt_phone').data('full');
    var agt_email = $('#agt_email').data('email');
    var name = $('#name').val();
    var phone = $('#phone').val();
    var user_email = $('#user_email').val();
    var message = $('#message').val();
    var current_url = window.listingUrl;
    var agt_id = $('#agt_id').val();
    var agt_name = $('#agt_name').val();
    var project = $('#project').val();
    var ipadd = $('#ipadd').val();

    // User Subscribe
    var subValue = $('#side_subscribe').prop("checked");
    if (subValue === true) {
    subValue = 1;
    } else {
    subValue = 0;
    }
    if (validation("#contact-form")) {
    // Facebook tracker
    fbq('trackCustom', 'ListingEnquiry', {
        title: title,
        nid: nid
    });
    //trovit tracker
    ta('send', 'lead');
    // ReadyMail
    readyMail(title, nid, name, phone, user_email, agt_email, message, current_url, agt_phone, subValue, agt_id, agt_name, project, ipadd, false,type);
    }

});

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...