When editing a field that had data in it to be blank, libs staff must
fill in spaces to take up that space. Otherwise, it retains the
old data (after saving record).
This patch will do that job (adding those spaces).
Signed-off-by: Simon Hieu Mai <hieu.mai@mnsu.edu>
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;
+ if ((new_value.length < length) & (new_value.length > 0)) return true;
+ if (new_value.length == 0){
+ for (var i = 0;i < length;i++){ new_value = new_value + ' ';}
+ }
var marc_rec = new MARC.Record ({ delimiter : '$', marcxml : xml_record.toXMLString() });
marc_rec.setFixedField(element.getAttribute('name'), new_value);