Custom Fields in Marketo Forms

Anonymous
Not applicable
Are custom fields able to complete calculations when a box is selected in a form?
Tags (1)
7 REPLIES 7
Jep_Castelein2
Level 10
Nice solution! Please note that the thank you page has a pre-filled form, which is where the JavaScript is reading the values from. If they wanted, they could use CSS to hide the form on the thank you page. 

Jep
Anonymous
Not applicable
Thanks Adam! I will have to ask why they are not! I am sure there is a reason!
Anonymous
Not applicable
I'm willing to bite on an interesting use case. In this example the form is a standard Marketo form, and on the follow up page they've added a bit of jQuery to customize the results. (replaced *script* with ***** in order not to break the community)

<****** type="text/javascript">
    // use no conflict mode for jQuery
  var $jQ = jQuery.noConflict();

  $jQ(document).ready(function() {

var dspend; 
var spendval=1;
var daudit;
var auditval=1;
var dloc;
var locval=1;
var dcarrier;
var carrierval=0;
var dinvoice;
var invoiceval=0;



var spend= $jQ('#Monthy_Telecom_Spend').attr('value');
if (spend == 1) { dspend = 'Less Than $10,000'; spendval=25;}
if (spend == 2) { dspend = '$10,001-$25,000'; spendval=20;}
if (spend == 3) { dspend = '$25,001-$50,000'; spendval=20;}
if (spend == 4) { dspend = '$50,001-$10,000'; spendval=15;}
if (spend == 5) { dspend = 'Greater than $100,000'; spendval=15;}
$jQ("#dspend").text(dspend); 


var audit= $jQ('#Date_of_Last_Telco_Audit').attr('value');
if (audit == 1) { daudit = 'Less than 1 year'; auditval=50;}
if (audit == 2) { daudit = '1-3 years'; auditval=80;}
if (audit == 3) { daudit = 'More than 3 years'; auditval=100;}
$jQ("#daudit").text(daudit); 


var loc= $jQ('#NumberOfLocations').attr('value');
if (loc == 1) { dloc = 'Less than 10'; locval=0;}
if (loc == 2) { dloc = '10-50'; locval=3;}
if (loc == 3) { dloc = 'More than 50'; locval=6;}
$jQ("#dloc").text(dloc); 


var carrier = $jQ('#Num_Carriers_Managed').attr('value');
if (carrier == 1) { dcarrier = '1-5'; carrierval=17280;}
if (carrier == 2) { dcarrier = '6-10'; carrierval=23040;}
if (carrier == 3) { dcarrier = 'More than 10'; carrierval=34560;}
$jQ("#dcarrier").text(dcarrier); 


var invoice= $jQ('#Num_Invoices_Managed').attr('value');
if (invoice == 1) { dinvoice = '1-10'; invoiceval=11520;}
if (invoice == 2) { dinvoice = '11-25'; invoiceval=23040;}
if (invoice == 3) { dinvoice = '26-50'; invoiceval=34560;}
if (invoice == 4) { dinvoice = 'More than 50'; invoiceval=46080;}
$jQ("#dinvoice").text(dinvoice); 

var savings= (spendval* (auditval/100)) + locval ;
$jQ("#savings").text(Math.round(savings)); 
 
var cost = carrierval + invoiceval ;
var strCost=cost.toString();
strCost=strCost.substring(0,2) +","+strCost.substring(2) ;
$jQ("#cost").text(strCost); 


  });
</******>Great example of using math on a landing page!!! Well done Sierra. PS- to vCOM, you're not using Google Analytics!
Anonymous
Not applicable
The from is done in Marketo. There is some type of script on the page. I am not a programer so it is hard for me to be descriptive. You could look at the source code for the landing page, that is where I would start.
Anonymous
Not applicable
Any ideas on how to do that, or a tutorial or article that would be helpful in creating something similar?
Anonymous
Not applicable
Look at what Marketo customer vCom solutions did with their calculator here - http://info.vcomsolutions.com/TelecomCalculator.html
Anonymous
Not applicable
A formula field type can set a value based on the value of another field (i.e. checkbox), but there are no calculations available.