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.
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: Database screenshot
You can select the preferred price column in a form select
<select id="aantal_tickets" name="aantal_tickets">
<option value="1" selected="selected">0 - 100</option>
<option value="2">101 - 500</option>
<option value="3">501 - 1000</option>
<option value="4">1001 - 10000</option>
<option value="5">> 10000</option>
</select>
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.
I tried playing around with a switch like this but didn't really get anywhere;
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;
}
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.
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.