Level 122
hat is timeslot ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I am trying to submit a form, which is fine, but i am having some trouble with this JS code:
document.querySelectorAll('.timeslot').forEach(timeslot => {
timeslot.addEventListener("change", () => {
let hours = timeslot.querySelector('.hours').value;
let minutes = timeslot.querySelector('.minuts').value;
end_time_value.value = (`${hours}:${minutes}`);
console.log("end_time_value = ", end_time_value.value);
});
});
When i submit the form, i only get the hours output (example: end_time = 12), and not the minuts. This is the html code:
<div class="">
<label for="" class="">End time</label>
<div class="border-2 border-black flex justify-center content-start">
<label for="">
<input type="text" name="end_time" id="end_time_value"
class="hours w-28 text-center"
maxlength="2"
minlength="1">
</label>
<label for="minuts">
<select class="minuts border-l-2 border-black" id="minut_box_selector">
<option value="00">00</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
</select>
</label>
</div>
<br>
If anybody has a suggestion, i am all ears!
Please or to participate in this conversation.