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=df899ac7-bc24-4692-8873-f2814d72b253&event=00000000-0000-0000-0000-000000000000&sourceurl=/training/3DEXPERIENCE-CATIA-Electrical-3D-Designer.aspx&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=df899ac7-bc24-4692-8873-f2814d72b253&event=00000000-0000-0000-0000-000000000000&sourceurl=/training/3DEXPERIENCE-CATIA-Electrical-3D-Designer.aspx&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('
I agree to receive communications and marketing information from the Solid Solutions group. We never share your information with third parties. Full details are explained in our Privacy Policy.
'); jQuery('#ssform').append(''); });