optimizer123
11-01-2012, 01:34 PM
http://www.screenr.com/78s7
As you can see whenever I click on the reserve button it doesnt save it.
I got a new code here:
function storeIt() {
var theSeats = document.getElementsByClassName('allseats')[0].getElementsByTagName('div');
var theArray = [];
for(i=0; i<theSeats; i++) {
if(theSeats[i].className=='zwart') {
// alert(theSeats[i].className);
theArray.push(1);
} else {
// alert(theSeats[i].className);
theArray.push(0);
window.localStorage.setItem(theSeats[i],1);
}
}
if(window.localStorage) window.localStorage.seats = theArray;
}
and here in my html:
<input type="button" value="Reserveer" onclick= "storeIt(); alert('Bedankt voor uw reservering.\nUw reserveringscode is: ' + Math.floor(Math.random()*(10000000 - 100000 + 1))+'\n\nU wordt nu doorgestuurd naar de homepagina.')">
I gave all the seats the classname allseats so it should work.. but why doesnt it?
As you can see whenever I click on the reserve button it doesnt save it.
I got a new code here:
function storeIt() {
var theSeats = document.getElementsByClassName('allseats')[0].getElementsByTagName('div');
var theArray = [];
for(i=0; i<theSeats; i++) {
if(theSeats[i].className=='zwart') {
// alert(theSeats[i].className);
theArray.push(1);
} else {
// alert(theSeats[i].className);
theArray.push(0);
window.localStorage.setItem(theSeats[i],1);
}
}
if(window.localStorage) window.localStorage.seats = theArray;
}
and here in my html:
<input type="button" value="Reserveer" onclick= "storeIt(); alert('Bedankt voor uw reservering.\nUw reserveringscode is: ' + Math.floor(Math.random()*(10000000 - 100000 + 1))+'\n\nU wordt nu doorgestuurd naar de homepagina.')">
I gave all the seats the classname allseats so it should work.. but why doesnt it?