bburnett
Posts: 22
|
| Posted: 04/23/2007, 3:01 PM |
|
I have an editable grid that has CCS listbox onchange events that use AJAX to update other listboxes. That's running well. Problem is when I call the jscript code below at onSubmit it does its thing but then I get an error: "Line: 0
Error: 'ptrkActualsElements[...].0.value' is null or not an object" (after the for loop has completed).
initptrkActualsElements();
var ED = document.forms["ptrkActuals"];
for ( theRow in ptrkActualsElements ){
if ((ptrkActualsElements[theRow][0].value=="") && (ptrkActualsElements[theRow][1].value=="")){
ptrkActualsElements[theRow][3].value="";
ptrkActualsElements[theRow][9][0].checked=false;
}
}
It's like this code is being run twice once by CCS (correctly) and a second time by Prototype? They both have event listeners. Anyone ever used AJAX and an editable grid? Any ideas? Thanks
_________________
Brandon Burnett
New Media Architect
REL Productions
West Des Moines, IA, USA
www.relonline.com |
 |
 |
CCT
Posts: 44
|
| Posted: 04/24/2007, 3:00 AM |
|
Actually, prototype overrides default JS Hash object and makes:
for (item in hash) { ... }
construction unusable. It's stated in prototype API docs. You should use "hash.each" method instead (this method is part of prototype extensions to Hash).
_________________
Get more CodeCharge Studio builders at http://codechargetools.com |
 |
 |
bburnett
Posts: 22
|
| Posted: 04/24/2007, 7:56 AM |
|
Thanks
While I didn't get the hash.each to work; I switched it to
for (i=0; i<ptrkActualsElements.length; i++) {
and that solved the problem.
_________________
Brandon Burnett
New Media Architect
REL Productions
West Des Moines, IA, USA
www.relonline.com |
 |
 |
|