jQuery('#form1').submit(function (e) { e.preventDefault(); var jsonData = {}; var count = 0; jQuery('.dynamicForm input').each(function () { var isGroup = 'NO'; var isList = 'NO'; var label = jQuery(this).attr('label'); if (jQuery(this).attr('group') == 'YES') { isGroup = 'YES' }; if (jQuery(this).attr('list') == 'YES') { isList = 'YES' }; if (jQuery(this).attr('type') == 'text' || jQuery(this).attr('type') == 'email') { jsonData[count] = [jQuery(this).attr('id'), jQuery(this).attr('type'), jQuery(this).val(), isGroup, isList, label]; } else if (jQuery(this).attr('type') == 'checkbox') { jsonData[count] = [jQuery(this).attr('id'), jQuery(this).attr('type'), jQuery(this).prop('checked'), isGroup, isList, label]; } else if (jQuery(this).attr('type') == 'radio') { jsonData[count] = [jQuery(this).attr('id'), jQuery(this).attr('type'), jQuery(this).prop('checked'), isGroup, isList, label]; } else { jsonData[count] = [jQuery(this).attr('id'), jQuery(this).attr('type'), jQuery(this).prop('checked'), isGroup, isList, label]; }; count += 1; }); jQuery('.dynamicForm textarea').each(function () { var label = jQuery(this).attr('label'); jsonData[count] = [jQuery(this).attr('id'), 'textarea', jQuery(this).val(), 'NO', 'NO', label]; count += 1; }); jQuery('.dynamicForm select').each(function () { var label = jQuery(this).attr('label'); jsonData[count] = [jQuery(this).attr('id'), 'select', jQuery(this).val(), 'NO', 'NO', label]; count += 1; }); var strJSON = window.btoa(JSON.stringify(jsonData)); jQuery.ajax({ method: 'GET', dataType: 'json', url: 'https://marketing.3dssg.co.uk/forms/submit-form.aspx?id=5eb8ff27-81b7-43cc-82e4-b5ebc764f85a&event=00000000-0000-0000-0000-000000000000&sourceurl=/blog/2023/04/the-answer-to-parallel-processing&query=' + strJSON, error: function (jqXHR, textStatus, errorThrown) { console.log('Error occured while saving the form'); }, complete: function (data) { var responseData = jQuery.parseJSON(data.responseText); console.log('Form saved successfully'); window.dataLayer = window.dataLayer || []; dataLayer.push({ 'event': 'purchase', 'transactionId': '' + responseData.guid + '', 'transactionAffiliation': 'solidsolutions.co.uk', 'transactionTotal': 0, 'transactionTax': 0, 'transactionShipping': 0, 'transactionProducts': [{ 'sku': '', 'name': '', 'category': 'Lead', 'price': 0, 'quantity': 1 }] }); window.location = "https://www.solidsolutions.co.uk/enquiries-thank-you.aspx?success=" + responseData.guid; }, }); }); jQuery('#aspnetForm').submit(function (e) { e.preventDefault(); var jsonData = {}; var count = 0; jQuery('.dynamicForm input').each(function () { var isGroup = 'NO'; var isList = 'NO'; var label = jQuery(this).attr('label'); if (jQuery(this).attr('group') == 'YES') { isGroup = 'YES' }; if (jQuery(this).attr('list') == 'YES') { isList = 'YES' }; if (jQuery(this).attr('type') == 'text' || jQuery(this).attr('type') == 'email') { jsonData[count] = [jQuery(this).attr('id'), jQuery(this).attr('type'), jQuery(this).val(), isGroup, isList, label]; } else if (jQuery(this).attr('type') == 'checkbox') { jsonData[count] = [jQuery(this).attr('id'), jQuery(this).attr('type'), jQuery(this).prop('checked'), isGroup, isList, label]; } else if (jQuery(this).attr('type') == 'radio') { jsonData[count] = [jQuery(this).attr('id'), jQuery(this).attr('type'), jQuery(this).prop('checked'), isGroup, isList, label]; } else { jsonData[count] = [jQuery(this).attr('id'), jQuery(this).attr('type'), jQuery(this).prop('checked'), isGroup, isList, label]; }; count += 1; }); jQuery('.dynamicForm textarea').each(function () { var label = jQuery(this).attr('label'); jsonData[count] = [jQuery(this).attr('id'), 'textarea', jQuery(this).val(), 'NO', 'NO', label]; count += 1; }); jQuery('.dynamicForm select').each(function () { var label = jQuery(this).attr('label'); jsonData[count] = [jQuery(this).attr('id'), 'select', jQuery(this).val(), 'NO', 'NO', label]; count += 1; }); var strJSON = window.btoa(JSON.stringify(jsonData)); jQuery.ajax({ method: 'GET', dataType: 'json', cache: false, url: 'https://marketing.3dssg.co.uk/forms/submit-form.aspx?id=5eb8ff27-81b7-43cc-82e4-b5ebc764f85a&event=00000000-0000-0000-0000-000000000000&sourceurl=/blog/2023/04/the-answer-to-parallel-processing&query=' + strJSON, error: function (jqXHR, textStatus, errorThrown) { console.log('Error occurred while saving the form'); }, complete: function (data) { var responseData = jQuery.parseJSON(data.responseText); console.log('Form saved successfully'); window.dataLayer = window.dataLayer || []; dataLayer.push({ 'event': 'purchase', 'transactionId': '' + responseData.guid + '', 'transactionAffiliation': 'solidsolutions.co.uk', 'transactionTotal': 0, 'transactionTax': 0, 'transactionShipping': 0, 'transactionProducts': [{ 'sku': '', 'name': '', 'category': 'Lead', 'price': 0, 'quantity': 1 }] }); window.location = "https://www.solidsolutions.co.uk/enquiries-thank-you.aspx?success=" + responseData.guid; }, }); }); jQuery(document).ready(function () { jQuery('#ssform').append('