AnsweredAssumed Answered

Evaluating each ProductID in a Repeating Section

Question asked by scott.bickel@oneblood.org on Jun 5, 2017
Latest reply on Jun 12, 2017 by emha

Hi all,

I have a repeating section containing several controls and javascript to handle each step in the process.  A product id (single line textbox) first accepts input and upon change, it calls a web service to validate the id and also to get some data about the product to then display next to it.  The web service call is working just fine, however it is only getting called on the first row's product id control.  Additional rows are not calling the web service.  

I am using javascript reference ("jsvProductID") for the control.

 

Here is my javascript:

NWF$(document).ready(function () {

NWF$('#' + jsvProductID).change(function () { event_LookupProduct(); });

});


function event_LookupProduct() {
var lookupValue = NWF$("#" + jsvProductID).val();
NWF$.ajax({
type: "GET",
url: "http://company.org/myservice/Rest/ProductSummary/ProductId=" + lookupValue,
dataType: "json",
success: function (response, type, xhr) {
onEquipmentLookupSucceeded(this, response);
},
error: function (xhr) {
window.alert("error: " + xhr.statusText);
}
});
return false;
}

Outcomes