I just solved it. It was a lot simpler than how I first thought.
In the html I loaded all peoplePerRoom-boxes and put hidden="true", and at the onChange of the room quantity box I put a function that checks the value, and through a for-loop changes the hidden-value for the peoplePerRoom-boxes accordingly.
Initially I was thinking along the lines of saving the quantity of rooms as a $_SESSION etc 😃.