Form Pre-Fill on Wordpress Page

Clinton_Hutson
Level 1

Form Pre-Fill on Wordpress Page

I have used Sanford's instruction set here: https://blog.teknkl.com/pre-fill-any-site-any-form/

I can not seem to get any of the data passed into the form.  The web page is: https://www.lifesize.com/en/contact-us-prefill/?mkt_tok=NzI1LUVLSi0xMDEAAAF-Y670HWLuJBAh5olPe9aaU4N-...

Not sure exactly what I am doing wrong.  Any thoughts would be greatly appreciated!  @SanfordWhiteman I have also attached the script code below: 

<!-- / Mkto Munchkin lib \ -->
<!-- standard Munchkin embed code goes here, just reminding you! -->
<!-- \ Mkto Munchkin lib / -->

<!-- / Mkto Forms 2.0 container, library, load form \ -->
<form id="2072"></form>
<script id="mktoForms2" 
  src="//app-ab26.marketo.com/js/forms2/js/forms2.min.js">
</script>
<script>
  MktoForms2.loadForm( "//app-ab26.marketo.com", "725-EKJ-101", 2072 );
</script>
<!-- \ Mkto Forms 2.0 container, library, load form / -->

<!-- / TEKNKL extended libraries \ -->
<script id="teknklSimpleDTO-1.0.4" 
  src="https://pages.lifesize.com/rs/725-EKJ-101/images/teknkl-simpledto-1.0.4.js">
</script>
<!-- \ TEKNKL extended libraries / -->

<!-- / Call DTP to pre-fill form \ -->
<script>
  var DTO = new SimpleDTO({
      domain: "lifesize.com",
      dataSrc: "https://pages.lifesize.com/dtp-1.0.4.html",
      debug: true,
      mode: "receive",
      cb: function(instance){
        var mktoFields = DTO.getGlobal()["mktoPreFillFields"];
        DTO.cleanup();
        MktoForms2.whenReady(function(form) {
          form.setValuesCoerced(mktoFields);
        });        
      }
  	});
</script>
<!-- \ Call DTP to pre-fill form / -->

 

Tags (2)
1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Form Pre-Fill on Wordpress Page

Two big problems here:

 

1. You’ve somehow HTML-encoded the script, so it’s not running at all, it’s just text.

SanfordWhiteman_0-1626805265081.png

 

2. Lots and lots of console errors because of load order. You need to make sure the Forms 2.0 library is loaded before code that does forms-related customizations.

SanfordWhiteman_1-1626805346787.png