JPoint Error "getAlternativeComments Error: undefined"

Apr 13, 2011 at 1:57 PM

Hello

I am trying to use JPoint to fill some form values from queryString. I tried it on one form succesfully, but on other forms I get following error:

"getAlternativeComments Error: undefined"

and then

"An error occured when reading the form. TypeError: 'length' is null or not an object."

The page is NewFormCustom.aspx with WebPartPages:DataFormWebPart. I have the following script in the page

<script type="text/javascript" src="//sharejpoint.googlecode.com/files/jPointLoader.js"></script>
<script type="text/javascript">
$(document).ready(function() { //Wait page to load and then apply webpart logic
 if(myjParts[JpartProcessing] != null)
 {
  var thisWebpart = myjParts[JpartProcessing];
  try
  {
   //jPart user code goes here ---------------------------
   
    $.each(jP.Form.readForm().Items, function (idx, formjQueryItem) {
    if(querySt(formjQueryItem.Name) != null)
     jP.Form[formjQueryItem.Name].val(querySt(formjQueryItem.Name));
   });

   //-----------------------------------------------------
  }catch(err){};
  JpartProcessing = JpartProcessing + 1;
 }
});

function querySt(ji)
{
       hu = window.location.search.substring(1);
       gy = hu.split("&");
       for (i=0;i<gy.length;i++)
       {
               ft = gy[i].split("=");
               if (ft[0].toUpperCase() == ji.toUpperCase()) //Fixed query so it is case insensitive
               {
                       return unescape(ft[1]);
               }
       }
       return null;
}

But the same error occurs when I only do

$(document).ready( function () { jP.Form.readForm(); }); 

Please, can you help me how solve this error?

IE7, Sharepoint Foundation 2010

Source aspx page
HTML code of the page

 

Thanks

Rosta

Developer
Oct 2, 2013 at 1:47 AM
Can you tell me if your list has 'allow management of content types' enabled in the 'Advanced settings'? I am interested to find out if enabling this will solve your problem.
Oct 9, 2013 at 10:34 PM
I am getting this same error.

I changed my list back and forth from "allow management of content types". It didn't affect the error in any way.
Aug 10, 2014 at 5:30 AM
Edited Aug 10, 2014 at 5:31 AM
I had this same type of issue. What I found out is my list template was exported from https://dev.contoso.com and imported in https://staging.contoso.com. These two site are not connected or accessible. I opened the template.stp as a cab file and edited the manifest.xml - the change I made was:
<?xml version="1.0" encoding="UTF-8" ?>
<ListTemplate WebUrl="https://dev.contoso.com">
<Details>
to
<?xml version="1.0" encoding="UTF-8" ?>
<ListTemplate WebUrl="https://staging.contoso.com">
<Details>
I recreated the template.stp from my modified manifest.xml and uploaded it into SharePoint. I then recreated the list - made the modifications for jPoint and low and behold no more error. Now I get to see if v0.8 works :)