SOLVED

Marketo Free Form LP with split JS for Mobile and Desktop

Go to solution
Jay_sandbox_Sin
Level 2

Marketo Free Form LP with split JS for Mobile and Desktop

Our web designer tried to split the same JS code but it is supporting either desktop or mobile.

The JS code function is to enable visibility based on the fill out form i.e. confirm button id .

is there any alternate way so that it can split same JS code for mobile and desktop layer in Marketo free form LP design? 

<script>
MktoForms2.whenReady(function (form){
  form.onSuccess(function(values, followUpUrl){
   form.getFormElem().hide();
   document.getElementById('confirmform').style.visibility = 'visible';
   return false;
 });
});
</script>
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Free Form LP with split JS for Mobile and Desktop

Simply showing/hiding a JS script block doesn't mean it doesn't execute: CSS-level visibility is irrelevant.

 

Instead, change the JS behavior by using the same breakpoints (i.e. media query) that the CSS does.

 

 

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Free Form LP with split JS for Mobile and Desktop

Simply showing/hiding a JS script block doesn't mean it doesn't execute: CSS-level visibility is irrelevant.

 

Instead, change the JS behavior by using the same breakpoints (i.e. media query) that the CSS does.