11/15/2017 - 11:39 PM

Grab URL Parameter to prefill form field

Grab's the value of url parameter "employer=" and sets the value into the marketo form field "Company" of the landing page. Also, has encoding special characters.

Example URL:

  MktoForms2.whenReady( function(form) {
     var urlParams   = new URLSearchParams(;
	   var employerName = urlParams.get('employer');
     form.vals( {"Company":employerName} );//set value in Employer field