Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

hide VAT field if company name is empty

$
0
0

Replies: 0

Hello!
Wanted to hide the VAT field if the company field is empty (due to business logics)
Tried:


let input = document.getElementById("billing_company")

  input.oninput = function() {
    if (input.value.length === 0) {
        console.log('empty!')
    document.getElementById('vat_number_field').style.display = 'none';
    }
    document.getElementById('vat_number_field').style.display = 'block';
  };

but it does not working. Any ideas?

PS found this topic:
https://wordpress.org/support/topic/only-show-vat-field-when-company-name-is-filled-in/
but still not working for me.

  • This topic was modified 9 minutes ago by gbllab.

Viewing all articles
Browse latest Browse all 59525

Trending Articles