kabila
Posts: 30
|
| Posted: 01/19/2010, 7:05 AM |
|
Hi:
I have re-reviewed the following and other related linked articles (e.g. Nicole's) http://forums.codecharge.com/posts.php?post_id=102959&s...able+javascript
I am trying to implement something similar. Javascript throws me an error EmpActiveElements is null or not an object on EmpActiveElements.length. It seems to go past the initEmpActiveElements(); and so I am confused how can I have the javascript locate the editable grid.
From other posts it seems like it is working code....Is there something that i am missing? On the page, I have a Record and an Editable Grid form.
====code====
<script language="JavaScript" type="text/javascript">
function sumamounts(){
var sumamt;
sumamt = 0;
initEmpActiveElements();
alert('hello2');
for(var j = 0; j < EmpActiveElements.length; j++){
// for(var j = 0; j < 4; j++){
alert('hello3');
sumamt += parseInt(EmpActiveElements[j][EmpActiveAmountID].value);
alert(sumamt);
}
alert(sumamt);
return sumamt;
}
</script>
========
Thank you much
-sam
|
 |
 |
datadoit
|
| Posted: 01/19/2010, 2:16 PM |
|
Make sure all of your components have an ID name assigned to them
(editable grids or record forms).
|
|
|
 |
kabila
Posts: 30
|
| Posted: 01/19/2010, 2:38 PM |
|
Thank you for the pointer. I checked the Name in the Data tab and also id in the Format tab of the properties. The name attribute in the Format has {HTMLFormName}.
If the name was not there, it should have yelled at the init<formname>Elements(); statement, right?
Appreciate any pointers...Thank you
sam
|
 |
 |
datadoit
|
| Posted: 01/19/2010, 4:27 PM |
|
That's correct. But I've run into this issue in the past, and the fix
was to actually input an ID name. I believe Yes! sent me a patch also.
Contact support and let them know your exact version number.
|
|
|
 |
kabila
Posts: 30
|
| Posted: 01/20/2010, 5:36 PM |
|
Although I had it all in place, you need to create a dummy client side event to help create the object in the code. Once I created that, the script ran just fine.
-sam
|
 |
 |