Skip to main content
Jay_sandbox_Sin
Level 2
Dec 18, 2020 1:24 PM UTC
Solved

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>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SanfordWhiteman
SanfordWhitemanAccepted solution
User Group Leader
Dec 18, 2020 5:07 PM UTC

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.

 

 

1 reply

SanfordWhiteman
User Group Leader
SanfordWhitemanUser Group LeaderAccepted solution
User Group Leader
Dec 18, 2020 5:07 PM UTC

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.

 

 

Translate