Q:

Enable and disable input field with select

I have a form, where I would like that the two input fields "CVR number" and "Telephone" is only enabled if the value is "Yes". (Se attached file which is the end result). The form is looking like this now: Example on my form 
I tried to make something work with the below code, but I am not sure that I am on the correct track? The second input field is not getting active when I use yes.
What do you think?
HTML
<form>
  <select id="mySelect" onChange="check(this);">
   <option>No</option>
   <option>Yes</option>
  </select>

  <input type="text" id="company" disabled="disabled" placeholder="CVR number">
  <input type="text" id="company" disabled="disabled" placeholder="Telephone">
</form>

JS
function check(elem) {
    document.getElementById('company').disabled = !elem.selectedIndex;
}

Updated HTML code
    <h3>Do you want a company account?</h3>  
      <div class="form-group">
        <select class="form-control"  id="mce-COMPANY" name="COMPANY" id="mySelect" onChange="check(this);">
         <option value="Nej">Nej</option>
         <option value="Ja">Ja</option>
        </select>
      </div>

      <input placeholder="CVR nummer" name="EMAIL" class="mail" type="text" id="mce-EMAIL" id="company1" disabled="disabled"></input>
        <span class="icon4"><i class="fa fa-envelope" aria-hidden="true"></i></span>

      <input placeholder="Telefonnummer" name="EMAIL" class="mail" type="text" id="mce-EMAIL" id="company2" disabled="disabled" ></input>
        <span class="icon4"><i class="fa fa-envelope" aria-hidden="true"></i></span>

function check(elem) {
    document.getElementById('company').disabled = !elem.selectedIndex;
}
<form>
  <select id="mySelect" onChange="check(this);">
   <option>No</option>
   <option>Yes</option>
  </select>

  <input type="text" id="company" disabled="disabled" placeholder="CVR number">
  <input type="text" id="company" disabled="disabled" placeholder="Telephone">
</form>

A:

You have used the same ID for both the fields.
Use 2 different Ids and it works..

function check(elem) {
    document.getElementById('company1').disabled = !elem.selectedIndex;
    document.getElementById('company2').disabled = !elem.selectedIndex;
}
<form>
  <select id="mySelect" onChange="check(this);">
   <option>No</option>
   <option>Yes</option>
  </select>

  <input type="text" id="company1" disabled="disabled" placeholder="CVR number">
  <input type="text" id="company2" disabled="disabled" placeholder="Telephone">
</form>

