Mobile Switcher Download Form

Email Address*

First Name*

Last Name*

Company Name*

Phone*

http://ift.tt/1mizbGd

// <![CDATA[
var dom0 = document.querySelector('#form890 #field0');var field0 = new LiveValidation(dom0, {validMessage: "", onlyOnBlur: true});field0.add(Validate.Format, {pattern: /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, failureMessage: "A valid email address is required"});field0.add(Validate.Presence, {failureMessage:"This field is required"});var dom1 = document.querySelector('#form890 #field1');var field1 = new LiveValidation(dom1, {validMessage: "", onlyOnBlur: true});field1.add(Validate.Presence, {failureMessage:"This field is required"});field1.add(Validate.Length, {tooShortMessage:"Invalid length for field value", tooLongMessage: "Invalid length for field value", minimum: 2, maximum: 30});var dom2 = document.querySelector('#form890 #field2');var field2 = new LiveValidation(dom2, {validMessage: "", onlyOnBlur: true});field2.add(Validate.Presence, {failureMessage:"This field is required"});field2.add(Validate.Length, {tooShortMessage:"Invalid length for field value", tooLongMessage: "Invalid length for field value", minimum: 2, maximum: 50});var dom3 = document.querySelector('#form890 #field3');var field3 = new LiveValidation(dom3, {validMessage: "", onlyOnBlur: true});field3.add(Validate.Length, {tooShortMessage:"Invalid length for field value", tooLongMessage: "Invalid length for field value", minimum: 1, maximum: 20});field3.add(Validate.Presence, {failureMessage:"This field is required"});var dom4 = document.querySelector('#form890 #field4');var field4 = new LiveValidation(dom4, {validMessage: "", onlyOnBlur: true});function resetSubmitButton(e){ var submitButtons = e.target.form.getElementsByClassName('submit-button'); for(var i=0;i<submitButtons.length;i++){ submitButtons[i].disabled = false; } }function addChangeHandler(elements){ for(var i=0; i<elements.length; i++){ elements[i].addEventListener('change', resetSubmitButton); } }var form = document.getElementById('form890'); addChangeHandler(form.getElementsByTagName('input')); addChangeHandler(form.getElementsByTagName('select')); addChangeHandler(form.getElementsByTagName('textarea'));
// ]]>


var emailAddress = “”;
var sfID = “”;

// <![CDATA[
var elqForms = function(){

var timerId = null, timeout = 5;
var bForm = document.querySelector("form.elq-form");

if ( !sfID ) {
sfID = readCookie("sfid");
console.log("cookie sfid=" + sfID);
}

// Not in the url, not in the cookie, set the default
if (!sfID) {
sfID = "701310000018vNjAAI";
}

//Set SFID
window.document.getElementById("field10").value = sfID;

if (!emailAddress) {
emailAddress = readCookie("emailAddress");
console.log("emailAddress=" + emailAddress);
}

this.WaitUntilCustomerGUIDIsRetrieved =function() {
if (!!(timerId)) {
if (timeout == 0) {
return;
}
if (typeof this.GetElqCustomerGUID === 'function') {
if (typeof this.GetElqContentPersonalizationValue === 'function') {
bForm.elements["elqCustomerGUID"].value = GetElqCustomerGUID();
SetElqContent();

return;
}
}
timeout -= 1;
}
timerId = setTimeout("WaitUntilCustomerGUIDIsRetrieved()", 500);
return;
}

function setFormFieldValue(elqForm, strFormFieldName, strContactFieldName){
if (elqForm.elements[strFormFieldName])
elqForm.elements[strFormFieldName].value = GetElqContentPersonalizationValue(strContactFieldName);
}

function SetElqContent(){
if (this.GetElqContentPersonalizationValue){

var elqForm;
var blnFound = false;
//find the form object from the form HTMLName
for (var formIndex = 0; formIndex < document.forms.length; formIndex++)
{
for (var elemIndex = 0; elemIndex < document.forms[formIndex].length; elemIndex++)
{
if (document.forms[formIndex].elements[elemIndex].name == "elqFormName")
{
if (document.forms[formIndex].elements[elemIndex].value == "USBlogForm")
{
elqForm = document.forms[formIndex];
blnFound = true;
break;
}
}
}
if (blnFound) break;
}

if (elqForm)
{
setFormFieldValue(elqForm, "lastName", "C_LastName");
setFormFieldValue(elqForm, "company", "C_Company");
setFormFieldValue(elqForm, "emailAddress", "C_EmailAddress");
setFormFieldValue(elqForm, "busPhone", "C_BusPhone");
setFormFieldValue(elqForm, "firstName", "C_FirstName");
setFormFieldValue(elqForm, "SFDCContactID", "C_SFDCContactID");
setFormFieldValue(elqForm, "SFDCLeadID", "C_SFDCLeadID");
}
}
}

_elqQ.push(['elqSetSiteId', "868446402"]);

if (emailAddress != null) {
_elqQ.push(['elqDataLookup', escape('25fda1e58c234a8889441ee62d2a7745'),'’ + escape(emailAddress)+”]);
//SetElqContent();
} else {
console.log(“No Pre-population!!”);
}

WaitUntilCustomerGUIDIsRetrieved();
_elqQ.push([‘elqGetCustomerGUID’]);

}();
// ]]>

from hibu Blog http://ift.tt/29JqaAM
via IFTTT

from Sawyer Adam http://ift.tt/29IWs07
via IFTTT

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s