SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Oct 2011
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem in responsetext and if condition

    Hi,

    Good day!

    I have a simple form for testing on displaying material data from barcode and I substr the value.

    for example the barcode = '10001CHE00102401100200250000.50'

    po_number = 10001
    item_code = CHE001
    supplier = 024
    uom = 01
    unique_id = 100200
    qty = 250000.50

    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.


    Thank you.
    Attached Files Attached Files

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by newphpcoder View Post
    I want to display a notification that the barcode is invalid.
    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.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Guru
    Join Date
    Oct 2011
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    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.
    It shows Invalid Barcode

    You mean this Sir ?>

    I attached the updated testing.php

    Thank you
    Attached Files Attached Files

  4. #4
    SitePoint Guru
    Join Date
    Oct 2011
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried to remove the ?>
    but still same output. the Invalid Code display on the textbox of PO Number instead of notification box.

    Thank you


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •