title: Why does switch-case in my javascript function not work?
body: <p>When I run my HTML-page and click on the select-boxes the switch-case statement in my script always returns the default value instead of one of the specific cases. I can't find out why this happens. Here is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function getvalue(offer) {
  
    var code = document.getElementById('channel1');
    var dtc = document.getElementById('channel2');
      var channelX = document.getElementById('channel3');
      var remark = document.getElementById('subchannel');
  
    switch (offer) {
    case "CC-C":
     code.value = "user1";
     dtc.value = "Position1"+remark;
        channelX.value = "VBnet";
     break;
    case "CC-D":
     code.value = "user2";
     dtc.value = "Postion2";
        channelX.value = "VBnet";
     break;
    default:
     code.value = "Owner";
     dtc.value = "Admin";
        channelX.value = "VBnet";
    }
   }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select class="validate[required] text-input form-control form-text required" id="channel1" name="submitted[channel1]" onchange="getvalue(this.value)"&gt;
            &lt;option value=""&gt;Choosechoice
            &lt;/option&gt;
            &lt;option value="CC-C"&gt;Height
            &lt;/option&gt;
            &lt;option value="CC-D"&gt;Low
            &lt;/option&gt;
  &lt;/select&gt;          
  &lt;select class="validate[required] text-input form-control form-text required" id="subchannel" name="submitted-subchannel" onfocusout="getvalue(this.value)"&gt;
  &lt;option value=""&gt;Choosechoice&lt;/option&gt;
   &lt;option value="Walkin"&gt;Medium&lt;/option&gt;
   &lt;option value="Walkout"&gt;Small&lt;/option&gt;
   &lt;/select&gt;
  
  &lt;input class="form-control form-text" id="channel3" maxlength="128" name="channel3" size="60" style="display:none;" type="text" value="info" /&gt;
      &lt;input class="form-control form-text" id="channel2" maxlength="128" name="description" size="60" style="display:none" type="text" value="Choosechoiceplease" /&gt; </code></pre>
  </div>
  </div>
  </p>