Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

additional field on onepage checkout for a specific country
 
sampei
Jr. Member
 
Total Posts:  5
Joined:  2013-01-16
 

Hi.

In onepage checkout, I would like to activate a field only if you select a particular country, the field is already created, how can I do to make it appear only when you select a specific billing country?

Thanks

Stefano

 
Magento Community Magento Community
Magento Community
Magento Community
 
sampei
Jr. Member
 
Total Posts:  5
Joined:  2013-01-16
 

up wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagePsycho
Moderator
 
Avatar
Total Posts:  1702
Joined:  2009-06-23
 

You can use javascript/jQuery as:

<script type="text/javascript">
jQuery(document).ready(function(){
        jQuery
('#billing\\:country_id').change(function() {
             
//do your actions here.. show hide of fields
        
});
   
})
</script>
May be it’s worth reading this article:
http://www.blog.magepsycho.com/configuring-city-as-dropdown-option-in-checkout-billing-shipping-address/
 
Magento Community Magento Community
Magento Community
Magento Community
 
sampei
Jr. Member
 
Total Posts:  5
Joined:  2013-01-16
 

Very very thanks MagePsycho.

I have modified the jquery script of the guide and it works perfectly wink

Thanks again

Stefano

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top