Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | addresses.settings.inc_.patch | 506 bytes | HUB |
Comments
Comment #1
codycraven CreditAttribution: codycraven commentedjoeflateau,
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.
Comment #2
shady_gun CreditAttribution: shady_gun commentedSo any updates on this? .. Even i need the same requirement
Comment #3
codycraven CreditAttribution: codycraven commentedStill 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.
Comment #4
joeflateau CreditAttribution: joeflateau commentedThanks Cody, I'll just wait for the fix. It isn't time critical.
Comment #5
AlexisWilke CreditAttribution: AlexisWilke commentedcodycraven,
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
Comment #6
HUB CreditAttribution: HUB commentedHi 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...
Comment #7
akaash19 CreditAttribution: akaash19 commentedHow 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.
Comment #8
AlexisWilke CreditAttribution: AlexisWilke commentedakaash,
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?
Thank you.
Alexis
Comment #9
akaash19 CreditAttribution: akaash19 commentedThanks 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
Comment #10
bwinett CreditAttribution: bwinett commentedCheck out this solution.