Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jQuery(document).ready(function($) {
"use strict"
$("[id^=field_o8v4sw-]").on("change", function() { //source field key
var sourceField = $(this).val(),
barcodeid = $(this).attr("id"),
index_number = barcodeid.substr(barcodeid.lastIndexOf("-")+1),
destination_field = "#field_6qubt-" + index_number;
$(destination_field).val(sourceField); //destination field key
$(destination_field).trigger({ type:'change', originalEvent:'custom' }); // trigger a change event in Lookup field so “watching” fields can update
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment