What Happens to Marketo Forms When JavaScript is Disabled

Issue

Using a browser with JavaScript disabled causes display and validation problems with Marketo forms.

 

 


Solution

When JavaScript is disabled in a browser, it can cause a couple of different behaviors. For embedded forms, the form will not load on the page because it is loaded by JavaScript. For non-embedded forms on a Marketo landing page, the form will load but it will be a bare bones version of the form that does not validate field input, because validation is handled by JavaScript.

If you want to display a message to users with JavaScript disabled, you can use the “noscript” tag to display a message that prompts users to enable it in order to render the page correctly:
https://www.w3schools.com/tags/tag_noscript.asp

Here’s an example using that with an embedded form:
<script src="//app-sjst.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_1001"></form>
<script>MktoForms2.loadForm("//app-sjst.marketo.com", "507-ILX-247", 1001);</script>
<noscript>You have JavaScript disabled! Please enable JavaScript for the best experience on this site.</noscript>

 


For a Marketo landing page, I added an HTML Element with just the last line from the example above:
<noscript>You have JavaScript disabled! Please enable JavaScript for the best experience on this site.</noscript>

 

Alternatively, you can use a redirect solution like this, which will send users with JavaScript disabled to another page:

<html>

<head>

<noscript>

  <meta http-equiv="refresh" content="0; URL=http://www.marketo.com">

</noscript>

</head>

<body>

<p>Fancy redirect page if JavaScript is not detected.</p>

</body>

</html>

 


Labels (2)