Why Magento js/varien/form.js error in IE - js fiddle

Why Magento js/varien/form.js error in IE - js fiddle

October 6, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Why Magento js/varien/form.js error in IE - js fiddle

Title: Resolving the Magento js/varien/form.js Error in Internet Explorer

Hello developers! Today we’re going to troubleshoot a common issue that many of you might be facing – the mysterious disappearance of the state dropdown menu in Magento when using certain browsers, particularly Internet Explorer.

A Closer Look at the Issue

The problem seems to stem from the varien/form.js script used by Magento. If you recall, this file handles various form elements and validation logic. In line 205, we have a snippet of code that’s supposed to add an option to the region (state) dropdown:

if (this.regionSelectEl.options.add) {
    this.regionSelectEl.options.add(option);
} else {
    this.regionSelectEl.appendChild(option);
}

However, in some cases – specifically when using Internet Explorer 8 or earlier – this code fails to execute correctly. The browser throws an invalid argument error on line 205, and lo and behold, the state dropdown menu vanishes from the checkout page.

Identifying the Root Cause

After digging into the issue further, it appears that the culprit is a conflict with a stripped-down version of Modernizr. Modernizr is an excellent tool for feature detection in JavaScript, but if not configured correctly, it can interfere with other scripts on your Magento site.

Our investigation revealed that the latest version of Modernizr was causing a compatibility issue with the varien/form.js script. The two were stepping on each other’s toes and causing this frustrating UI glitch.

Resolving the Conflict

To resolve this issue, you’ll need to make sure that your version of Modernizr plays nice with Magento’s core scripts.

Firstly, ensure you’re using a compatible version of Modernizr. As of writing, we recommend version 2.8.3 for Magento sites.

Next, double-check your Modernizr configuration and ensure it doesn’t override any essential features or functionality used by the varien/form.js script.

If you’re still experiencing issues, try disabling other JavaScript plugins temporarily to rule out any further conflicts.

A Step-by-Step Guide

Here’s a quick step-by-step guide on how to resolve this issue:

  1. Update your Modernizr plugin to version 2.8.3 or later.
  2. Review your Modernizr configuration and ensure it doesn’t interfere with Magento’s core scripts.
  3. If necessary, temporarily disable other JavaScript plugins to rule out conflicts.
  4. Clear your browser cache and try again.

Conclusion

The disappearance of the state dropdown menu in Internet Explorer is a common issue that can be frustrating to debug. By understanding the root cause – a conflict between Modernizr and Magento’s core scripts – we can take targeted steps to resolve it.

Remember, keeping your dependencies up-to-date and ensuring compatibility is key to maintaining a smooth customer experience across all browsers. If you’re looking for professional assistance with your Magento store, don’t hesitate to reach out to the experts at Laravel Company!

Until next time, keep coding!

Checkout Configuration Errors JavaScript

Our network