AKA:
Lang is 3 characters long. Entering 1 character would cause focus to leave.
MARC would also update incorrectly.
This only triggers the update when the full 3 characters are entered.
This not only prevents issues with catalogers editing multi-character fixed
fields but also makes it less likely they accidentally corrupt the records.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
var grid = document.getElementById('leaderGrid');
var recGrid = document.getElementById('recGrid');
var new_value = element.value;
+ // Don't take focus away/adjust the record on partial changes
+ var length = element.getAttribute('maxlength');
+ if(new_value.length < length) return true;
var marc_rec = new MARC.Record ({ delimiter : '$', marcxml : xml_record.toXMLString() });
marc_rec.setFixedField(element.getAttribute('name'), new_value);