title: Conditioning JavaScript switch with $_POST[]
body: <p>So first of all, I don't really have any prior Javascript experience, hence why I'm struggeling with something as basic as this. I'm pretty sure there's an answer out there, but due to English not being my first language I can't seem to find it.</p>
  
  <p>I'm working on website where the tariffs of multiple ticket companies are displayed in a table, called from a database. These tariffs change based on the amount of tickets ordered, so I made 5 different price columns, like the following image:
  <a href="https://i.stack.imgur.com/6btf0.png" rel="nofollow noreferrer">Database screenshot</a></p>
  
  <p>You can select the preferred price column in a form select</p>
  
  <pre><code>&lt;select id="aantal_tickets" name="aantal_tickets"&gt;
      &lt;option value="1" selected="selected"&gt;0 - 100&lt;/option&gt;
      &lt;option value="2"&gt;101 - 500&lt;/option&gt;
      &lt;option value="3"&gt;501 - 1000&lt;/option&gt;
      &lt;option value="4"&gt;1001 - 10000&lt;/option&gt;
      &lt;option value="5"&gt;&gt; 10000&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>It is my intention that the displayed price column matches the selected dropdown option. So if I select the first option, the first price column is displayed. If I select the second option, the second column is displayed etc.</p>
  
  <p>I tried playing around with a switch like this but didn't really get anywhere;</p>
  
  <pre><code>switch($_POST['aantal_tickets']) {
      case "1":
      $abc = option1;
      break;
  
      case "2":
      $abc = option2;
      break;
  
      case "1":
      $abc = option3;
      break;
  
      case "1":
      $abc = option4;
      break;
  
      case "1":
      $abc = option5;
      break;
  }
  </code></pre>
  
  <p>After days of looking through codes I can barely understand, I'm at the end of my rope here. If there's anyone that could help me out here, and possibly even explain it in a way that even I can understand, that'd be great.</p>
  
  <p>Also, I'm aware that this on its own can be done without JavaScript, but it needs to be done in real-time, so through a function.</p>