auto-focus barcode field on load
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 10 Feb 2012 14:38:57 +0000 (15:38 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 25 Mar 2019 14:41:15 +0000 (15:41 +0100)
labels/spinelabel-print.pl

index e219538..4d34d1d 100755 (executable)
@@ -133,13 +133,21 @@ body {
 
 <form action="$url" method="post">
 Enter another barcode:
-<input type=text name=barcode autofocus>
+<input id=focus_barcode type=text name=barcode autofocus>
 <input type=submit value="Print">
 </form>
 
 <h1>Last printed call number for $barcode on $station</h1>
 
 <img id="printed_label" src="http://printer-zebra.vbz.ffzg.hr/$barcode.png">
+
+<script type="text/javascript">
+function formfocus() {
+       document.getElementById('focus_barcode').focus();
+}
+window.onload = formfocus;
+</script>
+
 |;
 
 # XXX /FFZG