if the barcode has all its data or it has no problem or no missing info like po_number or item_code or the supplier from the database, it will display the information but if it is not match on the database data. I want to display a notification that the barcode is invalid.
I attached my code, database and sample screenshots my problem is on displaying the notification .
I tried to fix it but I can’t figured out why it did not display.
What does getbarcode_data.php output when you use a normal (non-ajax) post form to submit invalid barcode data?
Does it show “Invalid Barcode” or does it show delimited data?
If it still shows delimited data, then the PHP logic needs to be worked on.
If it shows “Invalid Barcode”, then it’s likely to be the closing PHP tag causing you trouble, resulting in a newline after the text too. A good solution for that is to remove the closing PHP tag from the PHP script.
Either way, it seems to be a PHP issue that is being dealt with here - so I’ll move things across to that forum for the meantime.