Fixing Error “[unknown object].fireEvent()”

Submitted by Eric on Thu, 03/29/2018 - 21:09
unknown object fireevent

Many people have already encountered this error in Magento when opening a client's registry or creating an order by admin. This is the error:

error: error in [unknown object].fireEvent(): 
event name: address_country_changed 
error message: zipElement.up(...).down(...) is undefined

This is how we can solve this:

  • Open file: app/design/adminhtml/default/default/template/directory/js/optional_zip_countries.phtml
  • Search for function setPostcodeOptional(zipElement, country)
  • Find the line below:
    zipElement.up(1).down('label > span.required').hide();


  • Replace for the code below:
    var zipElementLabel = zipElement.up(1).down('label > span.required');
    if (zipElementLabel)


  •  In the same file find the line below:
    zipElement.up(1).down('label > span.required').show();


  •  And replace for the following code:
    var zipElementLabel = zipElement.up(1).down('label > span.required');
    if (zipElementLabel);


Save the file, refresh cache and you will see this error is gone.



Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.