document.getElementById("Create").disabled = false;
}
+ JSAN.use('util.barcode');
+
for (var i = 0; i < count; i++) {
var tb = document.createElement('textbox'); node.appendChild(tb);
tb.setAttribute('ou_id',ou_id);
tb,
function() { ready_to_create({'target':tb}); setTimeout(function(){util.widgets.vertical_tab(tb);},0); }
);
- tb.addEventListener('change',ready_to_create,false);
+ //tb.addEventListener('change',ready_to_create,false);
+ tb.addEventListener('change', function(ev) {
+ var barcode = ev.target.value;
+ if ($('check_barcodes').checked && ! util.barcode.check(barcode) ) {
+ g.error.yns_alert( '"' + barcode + '" is an invalid barcode.','Invalid Barcode','OK',null,null,'Check here to confirm this message.');
+ setTimeout( function() { ev.target.select(); ev.target.focus(); }, 0);
+ }
+ }, false);
tb.addEventListener( 'focus', function(ev) { g.last_focus = ev.target; }, false );
}
} catch(E) {
<hbox style="border-bottom: solid black thin">
<hbox id="marc_cn"/>
<spacer flex="1" />
- <checkbox id="print_labels" label="Print Labels" persist="checked" accesskey="P"/>
+ <checkbox id="check_barcodes" label="Check Barcodes?" persist="checked" accesskey="B"/>
+ <checkbox id="print_labels" label="Print Labels?" persist="checked" accesskey="P"/>
<button id="Create" accesskey="C" label="Edit then Create" disabled="true" oncommand="g.stash_and_close();"/>
</hbox>
<grid flex="1">