I have few input elements which are wrapped on 'if' binding. Problem when I open a popup from one of these elements and setting a value from popup to opener, popup says element not found. Here's the code.
<!-- ko if: enableCustomerCode() -->
<a href="#" onclick="return getCustomerList();">
<img src="<%=path%>/images/blueSearch1.JPG" alt="Search Customer" border="0" height="16" />
</a>
<input type="hidden" id="customername" />
<input type="hidden" id="customerid" />
<input type="hidden" id="customercode" />
<input type="hidden" id="custOuId" />
<input type="hidden" id="custOuCode" />
<input type="hidden" id="customerallcurrency" />
<!-- /ko -->
function onPopUpClose() {
modal.orderBooking().customerCode($("#customercode").val());
}
It says $("#customercode").val() is null or undefined.
Sorry, it was my code problem, but now jquery autocomplete is not working
autoCompleteJQ($("#abc"), "ENTITYNAMEFORORDER", function(suggestion) {
modal.orderBooking().customerId(suggestion.dbId);
modal.orderBooking().customerCode(suggestion.id);
modal.orderBooking().customerName(suggestion.code);
});
Here abc
comes under if
binding