Hi Folks,
I am brand new to Javascript and I am trying to solve this issue:
[CODE]<SCRIPT LANGUAGE=JavaScript>
intImage = 2;
function swapImage() {
switch (intImage) {
case 1:
IMG1.src = “images/5_90.png”
intImage = 2
return(false);
case 2:
IMG1.src = “images/3_90.png”
intImage = 1
return(false);
}
}
</SCRIPT>
Using this Javascript and this
[CODE]<IMG id=”IMG1″ name=”IMG1″ src=”images/5_90.png”
onclick=”swapImage();”></p>
I am able to detect the state and switch between the 2 images (green/red)! As I am programming a theatre booking/reserving software for a friend of mine, I am looking for a way to achieve this:
Fetching a db and looking for an ID – if the Bool of the ID is yes, then display red – if its no, then display green. There are approx. 800 IDs (seats) in the theatre…The seats should be in a table – there I have faced the problem, that the code is not working when I have more than 1 image…
Thanks for any hints, your time and your help!
Best regards,
Stefan