Hey guys,
So what's getting pushed to this array is dependant on a few radio boxes. I've got this for standard and wheelchair seats:
if(document.getElementById('standardseat').checked) {
//Standard seat is checked
seatsArray.push(e.posX, e.posY);
}
else if(document.getElementById('wheelchairseat').checked) {
//Wheelchair seat is checked
seatsArray.push("Wheelchair " + e.posX, e.posY);
}
And this is the equivalent form code:
<input id="standardseat" type="radio" name="seat" value="standard" /> Standard seat
<input id="wheelchairseat" type="radio" name="seat" value="wheelchair" /> Wheelchair seat
But I want to add in some more radio boxes, which are separate from the standard/wheelchair seat:
<input id="backnave" type="radio" name="area" value="backnave" /> Back Nave
<input id="frontnave" type="radio" name="area" value="frontnave" /> Front nave
<input id="middlenave" type="radio" name="area" value="middlenave" /> Middle nave
And I want the push to also include this. To explain, if the user ticked "Wheelchair seat" and "Middle nave", the push should output ("MN, Wheelchair " + e.posX, e.posY). Is there any way of making this happen without manually including a lot of else if's for each possible outcome (I may even want to add a third set of radio boxes)?
Thanks!