        <style>
            input{
                margin-bottom: 10px;
                width:100%;
            }
            .wpcf7-form-control-wrap{
                top: 8px;
            }
            .daterx .wpcf7-list-item,
            .datesm .wpcf7-list-item,
            .dateq .wpcf7-list-item,
            .datedt .wpcf7-list-item {
                display: block;
                margin-bottom: 8px;
            }
            .date-blocked {
                color: #999;
                text-decoration: line-through;
            }
            .registration-closed-msg {
                display: block;
                color: #856404;
                background-color: #fff3cd;
                border: 1px solid #ffeeba;
                border-radius: 4px;
                padding: 8px 12px;
                margin-top: 5px;
                margin-bottom: 10px;
                font-size: 13px;
                font-style: italic;
            }
            .no-dates-available-msg {
                display: block;
                color: #721c24;
                background-color: #f8d7da;
                border: 1px solid #f5c6cb;
                border-radius: 4px;
                padding: 12px 15px;
                margin-top: 5px;
                margin-bottom: 10px;
                font-size: 14px;
            }
        </style>
        <form action="" method="post" id="inscriptions">
            <div class="row">
                <div class="col-md-12">
                    <h3>
                        Persoonlijke informatie                    </h3>
                </div>
                <div class="col-md-6">
                    <p>
                        <input placeholder="Voornaam*" value="" type="text" name="first_name" required>
                    </p>
                </div>
                <div class="col-md-6">
                    <p>
                        <input placeholder="Achternaam*" value="" type="text" name="last_name" required>
                    </p>
                </div>
                <div class="col-md-6">
                    <p>
                        <input placeholder="Geboortedatum (jj/mm/aa)*" value="" type="text" name="birthday" required>
                    </p>
                </div>
                <div class="col-md-6">
                    <p>
                        <input placeholder="Adres*" value="" type="text" name="adress" required>
                    </p>
                </div>
                <div class="col-md-4">
                    <p>
                        <input placeholder="Postcode*" value="" type="text" name="zipcode" required>
                    </p>
                </div>
                <div class="col-md-4">
                    <p>
                        <input placeholder="Stad*" value="" type="text" name="city" required>
                    </p>
                </div>
                <div class="col-md-4">
                    <p>
                        <input placeholder="Land*" value="" type="text" name="country" required>
                    </p>
                </div>
                <div class="col-md-6">
                    <p>
                        <input placeholder="E-mail*" value="" type="email" name="email" required>
                    </p>
                </div>
                <div class="col-md-6">
                    <p>
                        <input placeholder="Telefoon*" value="" type="tel" name="phone" required>
                    </p>
                </div>
                <div class="col-md-6">
                    <p>
                        <input placeholder="Contact in geval van nood*" value="" type="text" name="emergency_name" required>
                    </p>
                </div>
                <div class="col-md-6">
                    <p>
                        <input placeholder="Contactnummer voor noodgevallen*" value="" type="phone" name="emergency_phone" required>
                    </p>
                </div>
                <div style="margin-top: 20px;">
                    <div class="col-md-12 checkbox-mettet">
                        <p>
                            <label>
                                <input id="insurance" type="checkbox" name="insurance[]"><span>Ik wil graag de individuele verzekering van het circuit afsluiten voor €20/dag, te betalen tegelijk met de inschrijving.</span>
                            </label>
                        </p>
                    </div>
                    <div class="col-md-12 checkbox-mettet check-rules">
                        <p>
                            <label>
                                <input type="checkbox" name="rules[]"><span>Ik, ondergetekende, verklaar dat ik mij engageer voor Trackday, de specifieke reglementen van het evenement heb gelezen en mij daaraan onderwerp.</span>
                            </label>
                        </p>
                    </div>
                    <div class="col-md-12 checkbox-mettet check-newsletter">
                        <p>
                            <label>
                                <input type="checkbox" name="newsletter[]"><span>Schrijf u in voor onze nieuwsbrief om op de hoogte te blijven van ons laatste nieuws.</span>
                            </label>
                        </p>
                    </div>
                    <div class="col-md-12 checkbox-mettet check-gdpr">
                        <p>
                            <label>
                                <input type="checkbox" name="gdpr[]"><span>Ik geef toestemming aan Trackday om mijn persoonlijke gegevens te verzamelen en te verwerken in overeenstemming met het privacybeleid.</span>
                            </label>
                        </p>
                    </div>
                </div>
                <div class="col-md-12 disciplinemettet" style="margin-top: 20px;">
                    <p>
                        <label class="labelform">Gewenste discipline*</label>
                        <span class="wpcf7-form-control-wrap" data-name="discipline">
                            <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required wpcf7-exclusive-checkbox">
                                <span class="wpcf7-list-item first">
                                    <label>
                                        <input type="checkbox" name="discipline" value="RX">
                                        <span class="wpcf7-list-item-label">RX</span>
                                    </label>
                                </span>
                                <span class="wpcf7-list-item">
                                    <label>
                                        <input type="checkbox" name="discipline" value="Supermoto">
                                        <span class="wpcf7-list-item-label">Supermoto</span>
                                    </label>
                                </span>
                                <span class="wpcf7-list-item">
                                    <label>
                                        <input type="checkbox" name="discipline" value="Quad">
                                        <span class="wpcf7-list-item-label">Quad</span>
                                    </label>
                                </span>
                                <span class="wpcf7-list-item last">
                                    <label>
                                        <input type="checkbox" name="discipline" value="Dirt track">
                                        <span class="wpcf7-list-item-label">Dirt track</span>
                                    </label>
                                </span>
                            </span>
                            <span class="wpcf7-not-valid-tip" aria-hidden="true">

                            </span>
                        </span>
                    </p>
                </div>
                <br>
                <div id="rx" style="height: auto; display: none;">
                    <div class="col-md-12">
                        <p><label for="minibuggyrx" class="labelform">Minibuggy</label>
                        </p>
                    </div>
                    <div class="col-md-12" style="margin-bottom: 10px;">
                        <p>
                        <span class="wpcf7-form-control-wrap">
                            <span class="wpcf7-form-control wpcf7-checkbox">
                                <span class="wpcf7-list-item first last">
                                    <label>
                                        <input id="minibuggyrx" type="checkbox" name="minibuggyrx" value="50">
                                        <span class="wpcf7-list-item-label">Minibuggy (-55€)</span>
                                    </label>
                                </span>
                            </span>
                        </span>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p><label class="labelform">Aantal piloot(en)</label>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p><span class="wpcf7-form-control-wrap"><select class="wpcf7-form-control wpcf7-select categrx" aria-invalid="false" name="piloterx"><option value="">—Kies een optie alstublieft—</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select></span>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p><label class="labelform">Aantal copiloot(s)</label>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p><span class="wpcf7-form-control-wrap"><select class="wpcf7-form-control wpcf7-select categrx2" aria-invalid="false" name="copiloterx"><option value="">—Kies een optie alstublieft—</option><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select></span>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p><label class="labelform">Rijdata*</label>
                        </p>
                    </div>
                    <div class="col-md-12 daterx">
                        <p>
                            <span class="wpcf7-form-control-wrap">
                                <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required">
                                                                        <span class="wpcf7-list-item">
                                        <label>
                                            <input type="checkbox" name="daterx[]" value="22-11-2026" >
                                            <span class="wpcf7-list-item-label ">22-11-2026</span>
                                        </label>
                                                                            </span>
                                                                        <span class="wpcf7-list-item">
                                        <label>
                                            <input type="checkbox" name="daterx[]" value="06-12-2026" >
                                            <span class="wpcf7-list-item-label ">06-12-2026</span>
                                        </label>
                                                                            </span>
                                                                    </span>
                                <span class="wpcf7-not-valid-tip" aria-hidden="true"></span>
                            </span>
                        </p>
                    </div>
                </div>
                <br>
                <div id="supermoto" style="height: auto; display: none;">
                    <div class="col-md-12">
                        <p><label class="labelform">Niveau*</label>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p><span class="wpcf7-form-control-wrap"><select class="wpcf7-form-control wpcf7-select wpcf7-validates-as-required categrx3" aria-required="true" aria-invalid="false" name="niveau"><option value="">—Kies een optie alstublieft—</option><option value="Débutant">Beginner</option><option value="Confirmé">Bevestigd</option><option value="Expert">Expert</option></select><span class="wpcf7-not-valid-tip" aria-hidden="true"></span></span>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p><label for="location" class="labelform">Verhuur van Supermoto-uitrusting</label>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p>
                            <span class="wpcf7-form-control-wrap">
                                <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required">
                                    <span class="wpcf7-list-item first last">
                                        <label>
                                            <input id="location" type="checkbox" name="location[]" value="50">
                                            <span class="wpcf7-list-item-label">50€</span>
                                        </label>
                                    </span>
                                </span>
                                <span class="wpcf7-not-valid-tip" aria-hidden="true"></span>
                            </span>
                        </p>
                    </div>
                    <br>
                    <div class="col-md-12">
                        <p><label class="labelform">Rijdata*</label>
                        </p>
                    </div>
                    <div class="col-md-12 datesm">
                        <p>
                            <span class="wpcf7-form-control-wrap">
                                <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required">
                                                                        <span class="wpcf7-list-item">
                                        <label>
                                            <input type="checkbox" name="datesm[]" value="15-11-2026" >
                                            <span class="wpcf7-list-item-label ">15-11-2026</span>
                                        </label>
                                                                            </span>
                                                                        <span class="wpcf7-list-item">
                                        <label>
                                            <input type="checkbox" name="datesm[]" value="29-11-2026" >
                                            <span class="wpcf7-list-item-label ">29-11-2026</span>
                                        </label>
                                                                            </span>
                                                                    </span>
                                <span class="wpcf7-not-valid-tip" aria-hidden="true"></span>
                            </span>
                        </p>
                    </div>
                </div>
                <div id="quad" style="height: auto;display:none;">
                    <div class="col-md-12">
                        <p><label class="labelform">Rijdata*</label>
                        </p>
                    </div>
                    <div class="col-md-12 dateq">
                        <p>
                            <span class="wpcf7-form-control-wrap">
                                <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required">
                                                                        <span class="no-dates-available-msg">Er zijn momenteel geen datums beschikbaar voor deze discipline. Kom later nog eens terug.</span>
                                                                    </span>
                                <span class="wpcf7-not-valid-tip" aria-hidden="true"></span>
                            </span>
                        </p>
                    </div>
                </div>
                <div id="dirttrack" style="height: auto;display:none;">
                    <div class="col-md-12">
                        <p><label for="location_moto" class="labelform">Moto-verhuur</label>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p>
                            <span class="wpcf7-form-control-wrap">
                                <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required">
                                    <span class="wpcf7-list-item first last">
                                        <label>
                                            <input id="location_moto" type="checkbox" name="location_moto[]" value="50">
                                            <span class="wpcf7-list-item-label">50€</span>
                                        </label>
                                    </span>
                                </span>
                                <span class="wpcf7-not-valid-tip" aria-hidden="true"></span>
                            </span>
                        </p>
                    </div>
                    <br>
                    <div class="col-md-12">
                        <p><label for="location_equipment" class="labelform">Verhuur van volledige uitrusting</label>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p>
                            <span class="wpcf7-form-control-wrap">
                                <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required">
                                    <span class="wpcf7-list-item first last">
                                        <label>
                                            <input id="location_equipment" type="checkbox" name="location_equipment[]" value="50">
                                            <span class="wpcf7-list-item-label">50€</span>
                                        </label>
                                    </span>
                                </span>
                                <span class="wpcf7-not-valid-tip" aria-hidden="true"></span>
                            </span>
                        </p>
                    </div>
                    <br>
                    <div class="col-md-12">
                        <p><label for="location_vest_boots" class="labelform">Verhuur van beschermende vesten + laarzen</label>
                        </p>
                    </div>
                    <div class="col-md-12">
                        <p>
                            <span class="wpcf7-form-control-wrap">
                                <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required">
                                    <span class="wpcf7-list-item first last">
                                        <label>
                                            <input id="location_vest_boots" type="checkbox" name="location_vest_boots[]" value="25">
                                            <span class="wpcf7-list-item-label">25€</span>
                                        </label>
                                    </span>
                                </span>
                                <span class="wpcf7-not-valid-tip" aria-hidden="true"></span>
                            </span>
                        </p>
                    </div>
                    <br>
                    <div class="col-md-12">
                        <p><label class="labelform">Rijdata*</label>
                        </p>
                    </div>
                    <div class="col-md-12 datedt">
                        <p>
                            <span class="wpcf7-form-control-wrap">
                                <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required">
                                                                        <span class="no-dates-available-msg">Er zijn momenteel geen datums beschikbaar voor deze discipline. Kom later nog eens terug.</span>
                                                                    </span>
                                <span class="wpcf7-not-valid-tip" aria-hidden="true"></span>
                            </span>
                        </p>
                    </div>
                </div>
                <!--
                <div id="main" class="main_request_dashboard">
                    <table class="table table-light">
                        <thead>
                        <tr>
                            <th scope="col">Service</th>
                            <th scope="col">Prix</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>Comptes annuels et AG</td>
                            <td>200.00€</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                -->
                <input type="hidden" id="amount" name="amount" value="">
                <div class="col-md-12" style="margin-top: 40px;text-align: left;">
                    <h6><b>Prijs : </b><span id="total-price">0</span>€</h6>
                </div>
                                <div class="col-md-12" style="margin-top: 20px;">
                    <p>
                        <input type="submit" style="background-color: rgb(53, 115, 61);border-color: rgb(58, 119, 65);font-family: Ubuntu, Helvetica;color: white;padding: 5px;border-radius: 3px;" value="Ga door naar betaling">
                    </p>
                </div>
            </div>
        </form>
        <script>
            function checkComplete(elem, discipline, dates, niveau = false){
                $('.error-dd').remove();
                jQuery.ajax({
                    type: 'POST',
                    url: "https://mettet-xp.be/wp-admin/admin-ajax.php",
                    data: {
                        action: 'check_complete',
                        discipline: discipline,
                        dates: dates,
                        niveau: niveau,
                    },
                    success: function(response) {
                        if(response.data){
                            var limit = parseInt(response.data.limit);
                            var keysAboveLimit = [];
                            // Iterate over the object's keys
                            for (var key in response.data) {
                                // Check if the value is a number and greater than the limit
                                if (!isNaN(response.data[key]) && response.data[key] >= limit) {
                                    keysAboveLimit.push(key);
                                }
                            }
                            var checkboxName = "daterx";
                            if(discipline == "RX"){
                                checkboxName = "daterx";
                            }else if(discipline == "Supermoto"){
                                checkboxName = "datesm";
                            }else if(discipline == "Quad"){
                                checkboxName = "dateq";
                            }else if(discipline == "Dirt track"){
                                checkboxName = "datedt";
                            }

                            $('input[name="'+checkboxName+'[]"]').each(function() {
                                // Don't re-enable J-4 blocked checkboxes
                                if ($(this).data('blocked') !== true) {
                                    $(this).prop('disabled', false);
                                }
                            });
                            // Disable checkboxes with matching values (registration limit reached)
                            $('input[name="'+checkboxName+'[]"]').each(function() {
                                var checkboxValue = $(this).val();
                                if (keysAboveLimit.indexOf(checkboxValue) !== -1) {
                                    $(this).prop('disabled', true);
                                    $(this).prop('checked', false);
                                    // Only add error message if not already J-4 blocked
                                    if ($(this).data('blocked') !== true) {
                                        $(this).parent().parent().parent().parent().parent().append('<span class="error-dd" style="color:red">Inschrijvingslimiet bereikt voor de '+checkboxValue+ '.<br></span>')
                                    }
                                }
                            });
                        }
                    },
                    error: function(error) {
                        console.error('Error ajax');
                    }
                });
            }

            jQuery( document ).ready(function($) {
                var discipline = 0;
                var insurance = 0;
                var pilots = 0;
                var copilots = 0;
                var supermoto_rental = 0;
                var moto_rental = 0;
                var equipment_rental = 0;
                var vest_boots_rental = 0;
                var racedays = 1;

                var specialdays = 0;
                var pilots2 = 0;
                var copilots2 = 0;

                var supermoto_price = 105;
                var quad_price = 90;
                var rx_price = 180;

                $('input[type="checkbox"][name="datesm[]"]').change(function(){
                    let count = 0;
                    $('input[type="checkbox"][name="datesm[]"]').each(function () {
                        if ($(this).is(':checked')) {
                            count++;
                        }
                    });
                    racedays = count;

                    if(!racedays){
                        racedays = 1;
                    }
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('input[type="checkbox"][name="daterx[]"]').change(function(){
                    let count = 0;
                    let half_count = 0;
                    $('input[type="checkbox"][name="daterx[]"]').each(function () {
                        if($(this).is(':checked') && $(this).val() === "08-11-2025"){
                            half_count++;
                        }else if($(this).is(':checked')){
                            count++;
                        }
                    });
                    racedays = count;
                    if(!racedays && !half_count){
                        racedays = 1;
                    }

                    specialdays = half_count;

                    //special demi journée 08/11/2025
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('input[type="checkbox"][name="dateq[]"]').change(function(){
                    let count = 0;
                    $('input[type="checkbox"][name="dateq[]"]').each(function () {
                        if ($(this).is(':checked')) {
                            count++;
                        }
                    });
                    racedays = count;
                    if(!racedays){
                        racedays = 1;
                    }
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('input[type="checkbox"][name="datedt[]"]').change(function(){
                    let count = 0;
                    $('input[type="checkbox"][name="datedt[]"]').each(function () {
                        if ($(this).is(':checked')) {
                            count++;
                        }
                    });
                    racedays = count;
                    if(!racedays){
                        racedays = 1;
                    }
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('input[type="checkbox"][name="discipline"]').click(function() {
                    // Uncheck all checkboxes except the one that was clicked
                    $('input[type="checkbox"][name="discipline"]').not(this).prop('checked', false);
                });

                $('input[type="checkbox"][name="discipline"]').change(function() {
                    $('.error-tt').remove();
                    specialdays = 0;
                    pilots2= 0;
                    copilots2 = 0;
                    if($(this).val() == "RX"){
                        checkComplete($(this), "RX", ["22-11-2026","06-12-2026"]);
                        discipline = rx_price;
                        $('#rx').show();
                        $('#supermoto').hide();
                        $('#quad').hide();
                        $('#dirttrack').hide();
                        supermoto_rental = 0;
                        moto_rental = 0;
                        equipment_rental = 0;
                        vest_boots_rental = 0;
                        racedays = 1;
                        $('.categrx').change();
                        $('.categrx2').change();
                        $('#minibuggyrx').change();
                        $('input[type="checkbox"][name="daterx[]"]').change();
                    }
                    if($(this).val() == "Supermoto"){
                        discipline = supermoto_price;
                        $('#rx').hide();
                        $('#supermoto').show();
                        $('#quad').hide();
                        $('#dirttrack').hide();
                        pilots = 0;
                        copilots = 0;
                        moto_rental = 0;
                        equipment_rental = 0;
                        vest_boots_rental = 0;
                        racedays = 1;
                        $('#location').change();
                        $('input[type="checkbox"][name="datesm[]"]').change();
                    }
                    if($(this).val() == "Dirt track"){
                        discipline = 185;
                        $('#rx').hide();
                        $('#supermoto').hide();
                        $('#quad').hide();
                        $('#dirttrack').show();
                        pilots = 0;
                        copilots = 0;
                        supermoto_rental = 0;
                        racedays = 1;
                        $('#location_vest_boots').change();
                        $('#location_equipment').change();
                        $('#location_moto').change();
                        $('input[type="checkbox"][name="datedt[]"]').change();
                    }
                    if($(this).val() == "Quad"){
                        checkComplete($(this), "Quad", ["16-11-2025"]);
                        discipline = quad_price;
                        $('#rx').hide();
                        $('#supermoto').hide();
                        $('#quad').show();
                        $('#dirttrack').hide();
                        pilots = 0;
                        copilots = 0;
                        moto_rental = 0;
                        equipment_rental = 0;
                        vest_boots_rental = 0;
                        supermoto_rental = 0;
                        racedays = 1;
                        $('input[type="checkbox"][name="dateq[]"]').change();
                    }
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('#insurance').change(function(){
                    if($(this).is(':checked')){
                        insurance = 20;
                    }else{
                        insurance = 0;
                    }
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('.categrx').change(function(){
                    var value = $(this).val();
                    if($(this).val()) {
                        pilots = ($(this).val() * 105)-105;
                    }
                    $('input[type="checkbox"][name="daterx[]"]').each(function () {
                        if($(this).is(':checked') && $(this).val() === "08-11-2025"){
                            pilots2 = (value * 60)-60;
                        }
                    });
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('.categrx2').change(function(){
                    var value = $(this).val();
                    if($(this).val()) {
                        copilots = $(this).val() * 25;
                    }
                    $('input[type="checkbox"][name="daterx[]"]').each(function () {
                        if($(this).is(':checked') && $(this).val() === "08-11-2025"){
                            copilots2 = value * 12;
                        }
                    });
                    console.log(copilots2);
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('#minibuggyrx').change(function(){
                    if($(this).is(":checked")){
                        discipline = rx_price - 55;
                    }else{
                        discipline = rx_price;
                    }
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('.categrx3').change(function(){
                    //si besoin de check la limite par niveau uncomment
                    //var niveau = $(this).val();
                    //checkComplete($(this), "Supermoto", ["15-11-2026","29-11-2026"], niveau);
                    checkComplete($(this), "Supermoto", ["15-11-2026","29-11-2026"]);
                });

                $('#location').change(function(){
                    if($(this).is(":checked")){
                        supermoto_rental = 50;
                    }else{
                        supermoto_rental = 0;
                    }
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('#location_moto').change(function(){
                    if($(this).is(":checked")){
                        moto_rental = 50;
                    }else{
                        moto_rental = 0;
                    }
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('#location_equipment').change(function(){
                    if($(this).is(":checked")){
                        equipment_rental = 50;
                    }else{
                        equipment_rental = 0;
                    }
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('#location_vest_boots').change(function(){
                    if($(this).is(":checked")){
                        vest_boots_rental = 50;
                    }else{
                        vest_boots_rental = 0;
                    }
                    calculatePrice();
                    //$("#total-price").html(racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots));
                });

                $('#inscriptions').submit(function(e){
                    $('.error-tt').remove();
                    //Check discipline, rules & gdpr
                    var checkboxes = document.querySelectorAll('input[type="checkbox"][name="discipline"]');
                    var checkboxesRules = document.querySelectorAll('input[type="checkbox"][name="rules[]"]');
                    var checkboxesGdpr = document.querySelectorAll('input[type="checkbox"][name="gdpr[]"]');
                    let isChecked = false;
                    let isCheckedRules = false;
                    let isCheckedGdpr = false;
                    var selected_discipline = "";
                    checkboxes.forEach(function (checkbox) {
                        if (checkbox.checked) {
                            isChecked = true;
                            selected_discipline = checkbox.value;
                        }
                    });
                    checkboxesRules.forEach(function (checkbox) {
                        if (checkbox.checked) {
                            isCheckedRules = true;
                        }
                    });
                    checkboxesGdpr.forEach(function (checkbox) {
                        if (checkbox.checked) {
                            isCheckedGdpr = true;
                        }
                    });
                    if(!isCheckedRules){
                        e.preventDefault();
                        $('.check-rules').after('<span class="error-tt" style="color:red;margin-left:15px">Lees de specifieke regelgeving en dien deze in.</span>')
                        return;
                    }
                    if(!isCheckedGdpr){
                        e.preventDefault();
                        $('.check-gdpr').after('<span class="error-tt" style="color:red;margin-left:15px">Gelieve toestemming te geven voor het privacybeleid.</span>')
                        return;
                    }
                    if (!isChecked) {
                        e.preventDefault();
                        $('.disciplinemettet').after('<span class="error-tt" style="color:red;margin-left:15px">Selecteer een discipline.</span>')
                        return;
                    }
                    //Check rx
                    if(discipline == rx_price || selected_discipline == "RX"){
                        if(!$('select[name="piloterx"]').val()){
                            e.preventDefault();
                            $('.categrx').after('<span class="error-tt" style="color:red;margin-left:15px">Selecteer een aantal piloot(en).</span>')
                            return;
                        }
                        if($('select[name="copiloterx"]').val() < 0){
                            e.preventDefault();
                            $('.categrx2').after('<span class="error-tt" style="color:red;margin-left:15px">Selecteer een aantal copiloot(s).</span>')
                            return;
                        }
                        var checkboxesDates = document.querySelectorAll('input[type="checkbox"][name="daterx[]"]');
                        let isCheckedDates = false;
                        checkboxesDates.forEach(function (checkbox) {
                            if (checkbox.checked) {
                                isCheckedDates = true;
                            }
                        });
                        if(!isCheckedDates){
                            e.preventDefault();
                            $('.daterx').after('<span class="error-tt" style="color:red;margin-left:15px">Kies een datum</span>')
                            return;
                        }
                    }
                    //Check supermoto
                    if(discipline == supermoto_price && selected_discipline != "RX"){
                        if(!$('select[name="niveau"]').val()){
                            e.preventDefault();
                            $('.categrx3').after('<span class="error-tt" style="color:red;margin-left:15px">Selecteer uw niveau.</span>')
                            return;
                        }
                        var checkboxesDates = document.querySelectorAll('input[type="checkbox"][name="datesm[]"]');
                        let isCheckedDates = false;
                        checkboxesDates.forEach(function (checkbox) {
                            if (checkbox.checked) {
                                isCheckedDates = true;
                            }
                        });
                        if(!isCheckedDates){
                            e.preventDefault();
                            $('.datesm').after('<span class="error-tt" style="color:red;margin-left:15px">Kies een datum</span>')
                            return;
                        }
                    }
                    //Quad
                    if(discipline == quad_price && selected_discipline != "RX"){
                        var checkboxesDates = document.querySelectorAll('input[type="checkbox"][name="dateq[]"]');
                        let isCheckedDates = false;
                        checkboxesDates.forEach(function (checkbox) {
                            if (checkbox.checked) {
                                isCheckedDates = true;
                            }
                        });
                        if(!isCheckedDates){
                            e.preventDefault();
                            $('.dateq').after('<span class="error-tt" style="color:red;margin-left:15px">Kies een datum</span>')
                            return;
                        }
                    }
                    //Dirt Track
                    if(discipline == 185){
                        var checkboxesDates = document.querySelectorAll('input[type="checkbox"][name="datedt[]"]');
                        let isCheckedDates = false;
                        checkboxesDates.forEach(function (checkbox) {
                            if (checkbox.checked) {
                                isCheckedDates = true;
                            }
                        });
                        if(!isCheckedDates){
                            e.preventDefault();
                            $('.datedt').after('<span class="error-tt" style="color:red;margin-left:15px">Kies een datum</span>')
                            return;
                        }
                    }
                    //Set discipline price
                    $("#amount").val($("#total-price").html());
                });

                function calculatePrice(){
                    var specialdayprice = 90;
                    if($('#minibuggyrx').is(':checked')){
                        specialdayprice = 60;
                    }
                    $("#total-price").html((racedays * (discipline + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots + pilots)) + (specialdays * (specialdayprice + insurance + supermoto_rental + vest_boots_rental + equipment_rental + moto_rental + copilots2 + pilots2)));
                }
            });
        </script>
        {"id":16807,"date":"2023-10-13T12:35:18","date_gmt":"2023-10-13T10:35:18","guid":{"rendered":"https:\/\/www.circuit-mettet.be\/?page_id=16807"},"modified":"2023-10-13T12:42:00","modified_gmt":"2023-10-13T10:42:00","slug":"registraties","status":"publish","type":"page","link":"https:\/\/mettet-xp.be\/nl\/registraties\/","title":{"rendered":"Registraties"},"content":{"rendered":"\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":8,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-16807","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/mettet-xp.be\/nl\/wp-json\/wp\/v2\/pages\/16807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mettet-xp.be\/nl\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mettet-xp.be\/nl\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mettet-xp.be\/nl\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/mettet-xp.be\/nl\/wp-json\/wp\/v2\/comments?post=16807"}],"version-history":[{"count":2,"href":"https:\/\/mettet-xp.be\/nl\/wp-json\/wp\/v2\/pages\/16807\/revisions"}],"predecessor-version":[{"id":16809,"href":"https:\/\/mettet-xp.be\/nl\/wp-json\/wp\/v2\/pages\/16807\/revisions\/16809"}],"wp:attachment":[{"href":"https:\/\/mettet-xp.be\/nl\/wp-json\/wp\/v2\/media?parent=16807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}