There are cases where the Province would not be known, in those cases I'd like the Province field left blank, this is not possible with the current select list widget.

CommentFileSizeAuthor
#6 addresses.settings.inc_.patch506 bytesHUB
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

codycraven’s picture

joeflateau,

I recently worked on an AHAH project at work where I figured out a method to use AHAH in this situation which I believe would make this possible. I plan to get this in the next release.

shady_gun’s picture

So any updates on this? .. Even i need the same requirement

codycraven’s picture

Assigned: Unassigned » codycraven
Priority: Normal » Critical

Still working on it... if you need an immediate solution you can hack addresses.settings.inc to comment out the line that contains:
drupal_add_js(drupal_get_path('module', 'addresses') . '/addresses.js');

This will remove the dropdown selection but will allow your users to enter the name of province/state (a feature I added at the same time as the dropdown for users without javascript) or it's abbreviation.

joeflateau’s picture

Thanks Cody, I'll just wait for the fix. It isn't time critical.

AlexisWilke’s picture

codycraven,

Did you check in anything in that regard? It seems to be that an auto-complete would be much easier. Then we could have a flag in the main settings to let people choose between a field, the drop-down or auto-complete.

Using AHAH is terribly complicated for such a matter.

Thank you.
Alexis

HUB’s picture

Version: 6.x-1.08 » 6.x-1.10
Component: User interface » Code
Issue tags: +field, +option, +dropdown, +province, +blank
FileSize
506 bytes

Hi codycraven,

I don't know if is about the same thing we talked about today, you know having a ' ' in the province list, where we added array('' => '') + in the addresses_province_ajax() function in addresses.settings.inc .

So, to my mind, having a ' ' option in the dropdown for province is always wanted. If the field is required, it prevent the user to let the field on the first item by "error", then if not required, it give the possibility to the user to not select any province...

so, the modif was on line 310 from addresses.settings.inc
the line $element['#options'] = _addresses_province_get($country);
become $element['#options'] = array('' => '') + _addresses_province_get($country);

so i made patch for the file in question... from the addresses-6.x-1.10 version

Then, this fix only work in the case of using the province_ajax function, maybe this fix should be added to another place, but thinking of a province withough the country doesnt really appear logic to me, so the case of not using the ajax function will maybe never happen...

akaash19’s picture

How about singapore..I am having lots of problem with this as i am adding cck field to the content type.Its not allowing me top post for singapore.

AlexisWilke’s picture

akaash,

Singapore province array is empty. That could explain the problem you're having. You should remove the province from the list of items to enter... (for now). Could you provide a complete list of provinces for that country?

function addresses_province_list_sg() {
  return array(
  );
}

Thank you.
Alexis

akaash19’s picture

Thanks for the reply Alexis.Singapore has no provinces.
Also even when i remove the province it selects any other country by default while saving the node.

akaash

bwinett’s picture

Check out this solution.