Skip to content
Advertisement

Confusion with hiding some input fields using JS vanilla

I want to show hidden input fields when check “Buy on company” checkbox. It works, but if I uncheck it leaving “Is VAT exemt” checked and return: “VAT ID field” is shown with “Is VAT exemt” checkbox checked. So I want to avoid this situation.

Picture of situation:

enter image description here

JavaScript
JavaScript

Advertisement

Answer

The code for clicking on buy_on_company is always hiding or showing the billing_vat_id field. It needs to test that checkbox.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement