What Happens to Marketo Forms When JavaScript is Disabled | Community
Skip to main content
August 17, 2017

What Happens to Marketo Forms When JavaScript is Disabled

  • August 17, 2017
  • 1 reply
  • 3261 views

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:
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>

 


This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
Level 10
August 17, 2017

You might also note that PreFill requires JavaScript, as do all custom forms behaviors (e.g. custom onSubmit and onSuccess listeners). In addition, Munchkin won't work, so neither will session association -- for that matter, tracked links in emails don't even function without JavaScript!

All in all, it's not reasonable to expect core Marketo web functions to work in a noscript environment. You can only use Marketo as a primitive ESP without JS.