سؤال

I have the following scenario which is creating some problems.

  1. JSP - On the click of a button, load a td containing text-boxes which is read from a bean.
  2. One of the text box has a autocomplete feature.

My problem is after the td gets loaded(step 1) i get the following javascript error, due to which step 2 does not work.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)
Timestamp: Wed, 11 Sep 2013 11:37:16 UTC


Message: Unable to get value of the property 'insertAdjacentHTML': object is null or undefined
Line: 1631
Char: 5
Code: 0
URI: http://localhost:8080/intranet/gips/javascript/prototype.js

My JSP to load the data is as follows.

    function addEReviewNoForTraCurr(){
        var actionType='Add'; 
        new Ajax.Updater( 'eReviewNoForTraCurrDiv','saveEReviewNo?actionType=AddEReviewNoForTraCurrDiv',
                            { method: "post",parameters:actionType,evalScripts: true });
        return false;
    }

The td to load is as follows.

<td id="eReviewNoForTraCurrDiv" class="absPosDiv">
      <jsp:include page="../content/ajax/eReviewNoForTraCurrLoad.jsp" flush="true" />
</td>

Please let me know how to resolve the javascript error, so that my autocomplete starts working. Thanks in advance

هل كانت مفيدة؟

المحلول

Got over it, the problem was not because of the javascript, the Dynamic multiple text box has the same name and hence the autocomplete was unable to recognize request from which text box was coming from. Indexing the dynamically loaded textbox helped me get over it. Thanks for all the suggestions and updates.

Hope this helps someone in future.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top