Hi,
I am using the following code to default a value on a drop down within collection. The drop down has values from a lookup table. Also the 'defaultlocaton' field is outside the collection and it is a lookup value field. The script is working to default the value on targeted collection drop-down field. However, when a value is changed, I don't want the script to update the changed fields in the collection when a line gets appended. It should only update the default value on the new appended line.
Can someone please help with this script?
$('.cf-collection-append').click(function(){
grabVal() //deafult value for each GL drop downns in line
});
function grabVal() {
var loc = $('.defaultlocation input').val();
var a = '';
a = $('.cf-collection-block').find('.GLLoc option').filter(function () { return $(this).html() == loc;}).prop('selected', true);
}