1.

Solve : Getting 'submit' behavior from a data entry box using HTML?

Answer»

I am in the process of developing an online store, and need to complete it as soon as possible. I have been a COMPUTER programmer for years doing business applications, but have been working on development of my website for about the last 2 1/2 months, so I am a beginner at web development, and it is quite different from the programming languages I have experience in in many ways.  I have been writing a book for several years part-time, so I am a first-time author, and will be self publishing.  I need my online store to be working before I have my first printing done since my web site will be the primary WAY I will market my written book, and other books I am in the process of writing.
   I am using PHP with HTML and MySQL on an Apache SERVER.  The first program is called shop.php, and is working fine.  That program gives a description about my website, and on the bottom is a listing of the books I am selling, and the customer may click on a book title to see details of the book.  The second program is called view_product.php, which enables the customer to see detailed information about the book the customer has clicked on in the previous screen, and is considering ordering.  This program creates a screen which enables the customer to input the quantity of a specific book.  When the customer wants to go to the next screen, the customer SIMPLY inputs the quantity to order, and clicks on the 'Add to Cart' button.  That program is also working fine.  The problem occurs in the next program, which is named edit_cart.php, and the quantity box next to the 'Change Quantity' button behaves like a 'submit' button, and prevents the customer from changing the quantity.  The 'Change Quantity' button also behaves like a 'submit' button, and that is as it should be.  I have a GOOD HTML/CSS book, but does not cover a problem of this nature.  I have tried several different approaches to resolve this, but nothing I have tried works.  I'm hoping someone will help me resolve this problem soon.
   The first section of code below is from view_product.php, and works fine.  The second section of code is from edit_cart.php, and is where the problem is.  Let me know if you need more code or information from me.  Thanks.

Excerpt of code from view_product.php:

 


     
     
       
        Quantity:

   Various PHP commands with no HTML commands

if ($qty != 0) {
    echo '';
} else {
    echo '';
}
echo '     value="' . $qty . '"/>';
?>

     
     
   
Item Name QuantityPrice EachExtended Price
Item Name QuantityPrice EachExtended Price
     echo $prodcode; ?>">     alt=""/>[/url][/url]
         
     

   echo '';
   echo '';
   echo '';
   echo '';
   echo '       value="' . $qty . '"/>';
//   echo 'Change Quantity: ';
//   echo '';
?>

     
     
   
$ $        number_format($price * $qty, 2); ?>
   




Thanks,

aplusguy



Discussion

No Comment Found