It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Prototype.js error (Object doesn't support this property or

Prototype.js error (Object doesn't support this property or

Postby chrono25 on Fri May 15, 2009 10:39 pm

Hi everyone!, newbie here trying to figure out what's wrong, here's the problem, i have a text field with an onblur event that works just fine the 1st time its executed, however my webapp has an ADD button that triggers that text field to be ready again for more data, and when the onblur is executed for a 2nd time, i get the following 2 errors which are displayed on a debugger tool called companion.js " Object doesn't support this property or method (line 3483) (prototype.js)" which is inside this function of prototype.js
line 3483 = return $A($(form).getElementsByTagName('*')).inject([],

Code: Select all

getElements: function(form) {
    return $A($(form).getElementsByTagName('*')).inject([],
      function(elements, child) {
        if (Form.Element.Serializers[child.tagName.toLowerCase()])
          elements.push(Element.extend(child));
        return elements;
      }
    );
  },

the 2nd error says "Syntax error (line 3483) (prototype.js)" so it's on the same exact line and i unfortunately don't know prototype well enough to determine why that is happening.

here's the function that's executed on the onblur event of the text field

Code: Select all

function linkAjax2(args,form, src){

               
                frmBusca=form;
                origen=src;
                var numP
                var oDiv = document.getElementById("theFormDiv2");
                document.getElementById("partNumber").value="";
                var forma = document.frm;
                var part

            if(origen=="upd")
            {
               part=frmBusca.hred_partNumber;
            }

                if (origen=="add" && origen!="upd")
                {
                    part=frmBusca.partNumberb;
                }

                oDiv.style.left = getDimensions(part).x + document.documentElement.scrollLeft;
                oDiv.style.top = getDimensions(part).y + document.documentElement.scrollTop+20;
                oDiv.style.display="";

                var plant;
                if (origen=="add"){
                    plant=frmBusca.plm_name.value;
                    numP=frmBusca.partNumberb.value;
                }
                else{
                   plant=form.idPlanta.value;
                    numP=form.hred_partNumber.value;   
                }
                args=args+'&part='+numP+'&nomPlanta='+plant;
                //alert(args);
                //document.getElementById("partNumber").value=numP;
                new Ajax.Updater('theFormDiv2','<%=request.getContextPath()%>/flow/freight_detail/SetupFreightDetail'+args,{asynchronous:true, evalScripts:true, parameters:Form.serialize(forma)}); return false;
            }

please, i usually try to resolve this scenarios myself in order to learn but this time it's an urgent matter and i've hit a dead end .. please let me know what other details i could provide in order to obtain proper assistance. :?
chrono25
 
Posts: 1
Joined: Fri May 15, 2009 10:33 pm

Who is online

Users browsing this forum: psbot [Picsearch] and 5 guests