JSFiddle - React, Tailwind, and code Playground
by mtenschert
JavaScript
$(document).ready(function() {
$('.request_custom_fields_360000217518').append("<ul id='child_fields'></ul>");
var lastNumber = 0;
var $number_of_kids_input = $("#request_custom_fields_360000217518");
var prototype = '<select class="form-control child_age_selection"><option value="2" label="2">2</option><option value="3" label="3">3</option><option value="4" label="4">4</option><option value="5" label="5">5</option><option value="6" label="6">6</option><option value="7" label="7">7</option><option value="8" label="8">8</option><option value="9" label="9">9</option><option value="10" label="10">10</option><option value="11" label="11">11</option><option value="12" label="12">12</option><option value="13" label="13">13</option><option value="14" label="14">14</option><option value="15" label="15">15</option><option value="16" label="16">16</option><option value="17" label="17">17</option></select>';
var prototype_age_question = "<br><span style='margin-left: 2px;margin-top: 15px;display: block;font-style: italic;'>How old will be your children at the beginning of the rental?</span>"
var childrenAges = [];
var No_of_adults = '<small style="display: block;font-size: 95%;margin-bottom: 3px;font-style: italic;">over 18 years of age</small>';
var No_of_kids = '<small style="display: block;font-size: 95%;margin-bottom: 3px;font-style: italic;">under 18 years of age</small>';
var booking_number_label_small = '<small style="display: block;font-size: 95%;margin-bottom: 3px;font-style: italic;">You are able to find your booking number on your booking voucher</small>';
var destination_label_small = '<small style="display: block;font-size: 95%;margin-bottom: 3px;font-style: italic;">Where you want to go to? E.g. Val Thorens, Sölden, Sestriere, ...</small>';
// show age question, show No_of_adults, show No_of_kids
$('#request_custom_fields_360000217518').after(prototype_age_question);
$('div.request_custom_fields_360000199977...