I am using a barcode scanner to create an App, the code is scanned to TextArea input, when the scanner scan the barcode, it scans an Entry key and the entry key is save to Table too.. When I try to seach , using barcode scanner scan the code, the Enter key triggers the search function and no result was found as the Enter key does not include the sql statement, please help how to solve this problem?
thanks
1 Like
Hi @Jeffrey_Zhang, and welcome to the forum!
Are you able to share a bit more about your app structure, or export a json and share it so it is easier to understand what you're trying to achieve? Screenshots would be super helpful.
Is this a desktop app or mobile?
@MiguelOrtiz Thank you.
I build up a simple desktop app.
I use barcode scaner to read a barcode, when it scan in, it automaticly add a new line into the textarea field and save into DB table. that because the reader auto add the Enter key.
I have another page to search the code, same barcode reader, in the text input filed , an enter key will simulate click the search button instead of input the new line.
Does it make sense to you?
Jeffrey
Hi @Jeffrey_Zhang,
Thanks, it is making more sense.
So when you said:
the Enter key does not include the sql statement, please help how to solve this problem
What do you mean by this? When you hit Enter, what query do you run? Do you mind sharing that query?
Do you get an error in the console or doe sthe query run successfully but returns no results?
hi @MiguelOrtiz ,
Thanks for your prompt response.
let's see an example:
the DB table records as code "123456
"
I can see the query result shows the record as "123456\n"
when do the update sql with filter by code = "123456\n", it returns No row was updated.
I assuem that "123456
" not equal "123456\n"
regards
Jeffrey
Ah yes, now I understand the issue.
You could use trim()
, e.g. {{ textInput1.value.trim() }}
to remove the enter Key.
1 Like