Tuesday, December 05, 2006

Can't touch file upload elements with javascript

Son of a %#@%$. I was in the process of adding a slick feature to a complicated HTML form and ran into an unexpected problem.

The "form" has some input elements outside the actual <form> tag. The values from these elements are packaged up a certain way and injected into a hidden text field during the form submit process. Works like a charm.

I wanted to add the ability to upload files using this same basic mechanism -- create an <input type="file"> element inside the <form> based on info entered outside the form. It turns out that this isn't possible because the browser won't allow programmatic manipulation of file upload elements. Now that I think about it, the reason for this is painfully obvious.

I also tried moving the DOM node from its original location to a location inside the <form> (the data attached to the node was still entered by the user). No dice on that either.

Crap.

Friday, December 01, 2006

Installing fonts on Zebra ZPL Printers

DOS command to send a font to a Zebra printer using the ZTOOLS utility (specifically Z-Series printers; most likely specific to printers connected via parallel port):

zloadlit arial.zst lpt1

In the font file (eg. arial.zst), a directory of "R:" represents RAM, "E:" represents onboard flash, and "B:" represents the memory card.

Use: "~WC" to print a configuration label and "^WDR:*.*" to print the contents of the directory. "^CWX,R:ARIAL.FNT" assigns the font to a letter (X, in this case).