var jq = document.createElement('script'); jq.type = 'text/javascript'; jq.src = 'https://forms.mpmailserv.co.uk/includes/jqPlaceHolder/jqPlaceHolder.js'; document.getElementsByTagName('head')[0].appendChild(jq); if (!window.jQuery) { var jq = document.createElement('script'); jq.type = 'text/javascript'; jq.src = '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(jq); } function checkMPZForm15193() { var v0 = jQuery("#mpzdata-15193-firstname").val(); jQuery("#mpzdata-15193-firstname").removeClass('mpzFailedField115193'); jQuery(".mpzFrmDob").removeClass('mpzFailedField115193'); var v1 = jQuery("#mpzdata-15193-lastName").val(); jQuery("#mpzdata-15193-lastName").removeClass('mpzFailedField115193'); jQuery(".mpzFrmDob").removeClass('mpzFailedField115193'); var v2 = jQuery("#mpzdata-15193-email").val(); jQuery("#mpzdata-15193-email").removeClass('mpzFailedField115193'); jQuery(".mpzFrmDob").removeClass('mpzFailedField115193'); var v3 = jQuery("#mpzdata-15193-country").val(); jQuery("#mpzdata-15193-country").removeClass('mpzFailedField115193'); jQuery(".mpzFrmDob").removeClass('mpzFailedField115193'); var failed = 0; if(v0.length < 1) { failed = 1; jQuery("#mpzdata-15193-firstname").addClass('mpzFailedField115193'); } if(v1.length < 1) { failed = 1; jQuery("#mpzdata-15193-lastName").addClass('mpzFailedField115193'); } if(v2.length < 1) { failed = 1; jQuery("#mpzdata-15193-email").addClass('mpzFailedField115193'); } if(v2.indexOf("@") < 1 || v2.indexOf(".") < 1 || v2.length < 5) { failed = 1; jQuery("#mpzdata-15193-email").addClass('mpzFailedField115193'); } if(v3.length < 1) { failed = 1; jQuery("#mpzdata-15193-country").addClass('mpzFailedField115193'); } if(failed == 0) { jQuery("#mpzErrHolder15193").html("Checking Email"); jQuery.ajax({ type: "POST", url: 'https://forms.mpmailserv.co.uk/aj/cp3submit.asp?formID=15193&groupID=40517&callback=?', data: jQuery("#mpzForm115193 input").serialize(), dataType: 'jsonp', success: function(data) { if(data == "OK") { jQuery("#mpzErrHolder15193").html("Thank you! You have successfully subscribed to our newsletter."); } else { jQuery("#mpzErrHolder15193").html(data); } } }); } } function mpzDOBchanger(theID) { var theDate = jQuery("#mpzdob-yy-" + theID).val() + "-" + jQuery("#mpzdob-mm-" + theID).val() + "-" + jQuery("#mpzdob-dd-" + theID).val(); console.log(theDate); jQuery("#mpzdata-" + theID).val(theDate); } function isDate(txtDate) { var currVal = txtDate; if(currVal == '') return false; if(currVal.indexOf("-") < 1) { return false; } dtArray = currVal.split("-"); if (dtArray == null) return false; //Checks for yyyy/mm/dd format. dtMonth = dtArray[1]; dtDay= dtArray[2]; dtYear = dtArray[0]; if (dtMonth < 1 || dtMonth > 12) return false; else if (dtDay < 1 || dtDay> 31) return false; else if ((dtMonth==4 || dtMonth==6 || dtMonth==9 || dtMonth==11) && dtDay ==31) return false; else if (dtMonth == 2) { var isleap = (dtYear % 4 == 0 && (dtYear % 100 != 0 || dtYear % 400 == 0)); if (dtDay> 29 || (dtDay ==29 && !isleap)) return false; } return true; } function URLDecode(psEncodeString) { // Create a regular expression to search all +s in the string var lsRegExp = /\+/g; // Return the decoded string return unescape(String(psEncodeString).replace(lsRegExp, " ")); } var thisContent = URLDecode('
Newsletter Signup
Signup for news and special offers!
Subscribe
'); document.write(thisContent);