Jump to content

State Field is Empty *Urgent*


Recommended Posts

  • 1 month later...

I had a similiar issue and it turned out my statesManagement.js file was bad. Back it up first and try this.. if it does not work to fix your issue revert to your back up and keep trying.. Good luck.. this worked for me in version 1.3.6 on my site.
I changed my themes>theme name file>js>tools>statesManagement.js file to this:

and it worked perfectly:

$(document).ready(function(){
   $('select#id_country').change(function(){
       updateState();
       updateNeedIDNumber();
   });
   updateState();
   updateNeedIDNumber();
});

function updateState()
{
   $('select#id_state option:not(:first-child)').remove();
   var states = countries[$('select#id_country').val()];
   if(typeof(states) != 'undefined')
   {
       for (indexState in states)
       {
           //ie bug fix
           if (indexState != 'indexOf')
               $('select#id_state').append(''+states[indexState]+'');
       }
       $('p.id_state:hidden').slideDown('slow');
   }
   else
       $('p.id_state').slideUp('fast');
}

function updateNeedIDNumber()
{
   var idCountry = parseInt($('select#id_country').val());

   if ($.inArray(idCountry, countriesNeedIDNumber) >= 0)
       $('fieldset.dni').slideDown('slow');
   else
       $('fieldset.dni').slideUp('fast');
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...