Home > Back-end >  Preserve line feeds in scanner input in HTML element
Preserve line feeds in scanner input in HTML element

Time:07-21

I'm using a Zebra DS9908 scanner to scan a bar code and put the data on an HTML page. What element should I use to preserve all input characters? I've dried both a and , but in both cases the line feed characters between the records in the bard code data are being stripped off. I've tried "white-space: pre-wrap", but that has no effect.

Note, the scanner works via keyboard input. When I scan the barcode into notepad, it works fine.

The data is driver's license data. The bar code is PDF417 and the data formats are from AAMVA. A sample of the data is below. I don't have any questions on that. I'm trying to find a way to stream ALL characters to an HTML element, including line feeds. Line feed are used to separate the fields.

ANSI 6360100102DL00390183ZF02220047DLDAAJDOE,JOHN
DAG555 5th St
DAIMIAMI
DAJFL
DAK38451
DAQH50000000000

CodePudding user response:

I found this question in stack overflow: Multiple lines of input in <input type="text" />

Have you tried the textarea html tag? That one supports multiple lines of data.

An example of using a textarea html tag:

<textarea name="Text1" cols="40" rows="5"></textarea>

CodePudding user response:

You can also try using a tag

<code></code> 
  • Related