DrEvil
FCRI Associate!
- Reaction score
- 111
Ok so I didn't really know what to call the thread, but more to the point!
I have a load function that sets the default values on 5 fields, and adds an onmouseover event but the event everytime has the same parameter...
hoverA(id) just shows the id (which I will change later...)
but it always shows the last value 'P5'
I'm sure I'm doing something really stupid wrong... but I can't figure it out...
thanks for helping
I have a load function that sets the default values on 5 fields, and adds an onmouseover event but the event everytime has the same parameter...
PHP:
while(i<=5){
id='P'+i.toString();
d=document.getElementById('c'+id);//.innerHTML="Not Started";
// The 'status' box
d.innerHTML="Not Started";
d.style.backgroundColor="#FFFF00";
d=document.getElementById(id);
// The actual 'name' of the box
d.onmouseover=function(){hoverA(id);};
//alert(id);
i++;
}
hoverA(id) just shows the id (which I will change later...)
but it always shows the last value 'P5'
I'm sure I'm doing something really stupid wrong... but I can't figure it out...
thanks for helping