Thanks Walter

That did the trick. I sometimes define variables as in php with the $. Just could not see it. Thanks again.


On 12/23/2011 10:28 PM, Walter Lee Davis wrote:
The problem here is that you're clobbering Prototype's $A() function, which is used to 
initialize and "extend" an array. Choose a different name for your variable in 
line 7 of your example -- anything that isn't also used in Prototype -- and you should be 
all set. $A is used all over the place inside of Prototype itself, which is why it's 
getting funny results. Once your function has evaluated, that variable is clobbering the 
function from the global space.

Walter

On Dec 23, 2011, at 7:15 PM, Marty Amberg wrote:

maybe some one could point me in the right direction.

I use this code to extract the values from a table and if the table entry is 
blank  it removes the tr element.   The first time thru it works great. Updates 
the db and returns all to normal.
The next time I get this error

Thanks again.


$A is not a function
  var expression = $A(arguments).join(', ');
prototype.js (line 3920

Here is the code
updateRecords:function() {

var fp1 =$$('input.formData');
var  pa = new Array;
   fp1.each(function(element) {    // reads the table data     // it fails  here
         if (element.value  == " " | element.value  == ""){
             $A = element.ancestors();   // goes back and gets the tags
             var  rm = $A[1];   // removes the tr tag
             rm.remove();

         } else pa.push(element.value);   // otherwise sets if up for a db 
update

   });

     arrayNamey = new Object;
    arrayNamey.name_division_groups = this.div_id;
    arrayNamey.passArray = pa;
  this._grpUpdateDB(arrayNamey);
},

--
Marty Amberg


--
You received this message because you are subscribed to the Google Groups 
"Prototype&  script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

--
Marty Amberg
EdenStreet Consulting
w:978-741-7518
c:978-821-1309

--
You received this message because you are subscribed to the Google Groups "Prototype 
& script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to