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>
Solved! Go to Solution.
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.