Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6

Started by SteP[IT], December 18, 2016, 13:39:51 PM

Previous topic - Next topic

SteP[IT]

Hi All
In the past I made a simple javascript (using jQuery functions) to hide/show some fields in user registration/edit from: this script hides some fields based on the first user form radio button value.
It hides/shows tables and fields based on their id (I customized the VM edit_address_userfields.php template to add id to tables).
After upgrading from 3.0.16 to 3.0.18.6 I have a problem in displaying Country and City dropdowns: the VM script is no more able to assign them their dynamic width.
Is there a way to understand which VM recent change is causing this??? I can't locate the script currently assigning the dynamic width to the dropdowns.
You can see the 3.0.16 version working at http://toolware.it/it/registrazione-clienti-rivenditori.html : clicking on one of the radiobutton values 'Mi iscrivo come CLIENTE PRIVATO (NON HO una PARTITA IVA)' or 'Mi iscrivo come SOCIETÀ/Libero Professionista (HO una PARTITA IVA)' or 'Mi iscrivo come RIVENDITORE' the script toggles some fields as desired. The same script dosn't work anymore in VM 3.0.18.6, so I presume something changed somewhere...
It seems the actual VM version can't assign dinamyc width to elements having an id and/or being hidden, but the previous was working.
Thank you in advance for any hint.
Regards
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

SteP[IT]

I have simply upgraded to VM 3.0.18, no other changes: the table containing Country and City dropdowns are set to hidden when loading the page, and then set to show when checking the radiobutton, as before.
But before the dropdowns width were correctly assigned (calculated on the dropdown field content), and now are  set to 0

After upgrading I get for example this:
<div id="virtuemart_country_id_field_chzn" class="chzn-container chzn-container-single" style="width: 0px;">

before uprading I was getting this:
<div id="virtuemart_country_id_field_chzn" class="chzn-container chzn-container-single" style="width: 351px;">

As you can see, before upgrading the width was correctly assigned to the <div>. And it was also correctly changing when choosing another dropdown value, according with the choosen dropdown value string lenght
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

GJC Web Design

maybe the chosen version has changed  .. or chosen can't detect the width if initially set to display none?
test by displaying initially
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

SteP[IT]

Already tested when the table is initially set to display, and it works. It doesn't work anymore when the table start as hidden. Any hint on where to look to find what has changed?
Previuos VM version was working also when table was hidden
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

SteP[IT]

Yes, I made the same look for: this is why I'm asking for any hint... maybe Milbo could please help me, when having spare time? Thanks in advance. Regards
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

GJC Web Design

In the meantime can u not just target the width with a css !important if the width is the only problem?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

SteP[IT]

I would, but the width it embedded and set dynamically: it's not assigned to the intial dropdown (that is actually hidden by VM default mode) created by php template, but to an overlapped dropdown element probably inserted by a script, so it's impossible for me to set it in any manner without locating the script originating it (due to my limited specific knowledge)
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

SteP[IT]

To get the same results I have sorrounded each table with a div, zeroing its height. It seems to have solved the issue.
Thank you anyway for helping
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/