Hi all,
I’m having some trouble with the this…
I have a PHP based calendar where the cells will change color depending on the number of clicks… this all works fine, but is pointless if I can’t send the outcome along in an email. I can do this with PHP but first need to get the values into a hidden field.
This is what I have:
<script type="text/javascript">
function countClicks (obj){
if (!obj.count) {
obj.count = 0;
}
obj.count++;
if (obj.count > 4) {obj.count = 1};
if(obj.count == 1){
obj.style.color='#FFFFFF';
obj.style.backgroundColor='#66CC33';
obj.parentNode.style.backgroundColor='#66CC33';
document.getElementById("availability").value='Available';
}
if (obj.count == 2){
obj.style.color='#FFFFFF';
obj.style.backgroundColor='#FF0000';
obj.parentNode.style.backgroundColor='#FF0000';
document.getElementById("availability").value='Not Available';
}
if (obj.count == 3){
obj.style.color='#FFFFFF';
obj.style.backgroundColor='#FFCC33';
obj.parentNode.style.backgroundColor='#FFCC33';
document.getElementById("availability").value='Working';
}
if (obj.count == 4){
obj.style.color='#000000';
obj.style.backgroundColor='#FFFFFF';
obj.parentNode.style.backgroundColor='#FFFFFF';
document.getElementById("availability").value='Not Set';
}
}
</script>
and…
echo "<input type=\\"hidden\\" name=\\"availability\\" id=\\"availability\\" value=\\"\\">";
All I’m trying to do is populate value with either ‘available’, ‘not available’, ‘working’ or ‘not set’…
however, it is worth noting that each cell may have a different value, e.g. 1 cell might be working while the other is not available… so i need to pass the values of all the cells.
Can anyone help me out here.
Many thanks,
Greens85