Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    pass the value between two table

    im develop a transaction function here. as you can see below, there are two tables. which is the first one is for display the item and the second table is for purchasing. what i want to do is, the row for item in first table is clickable. as the row is click, the item that have been choose come out in the second table. and at the second table cell for discount can be editable and the total price is changing by the discount. is anyone can help me how to pass the value between the two table?

    Code:
    <fieldset>
    <legend>Item Show</legend>
    <table border="1">
    <tr>
      <td>Item Name</td>
        <td>Item Code</td>
        <td>Manufacturer</td>
        <td>Price</td>
        <td>Stock</td>
    </tr>
    <?php
    while($row = mysql_fetch_array($result))
      {
    ?>
    <tr>
      <td><?php echo $row['item_name']; ?></td>
        <td><?php echo $row['item_code']; ?></td>
        <td><?php echo $row['item_manufacturer']; ?></td>
        <td><?php echo $row['sell_price']; ?></td>
        <td><?php echo $row['stock']; ?></td>
    </tr>
    <?php
    }
    ?>
    </table>
    </fieldset>
    
    <fieldset>
    <legend>Item Sale</legend>
    <table border="1">
    <tr>
      <td>Item name</td>
        <td>Item Code</td>
        <td>Stock</td>
        <td>Price</td>
        <td>Quantity</td>
        <td>Discount</td>
        <td>Total Price</td>
    </tr>
    </table>
    </fieldset>

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    By "table" are you referring to a storage level such as mysql, or are you referring to the visually rendered tables within the HTML?
    If you mean the dbms, that's a simple matter of issuing an INSERT statement. The purchase would be related to the provided data.
    If you mean visually, that's entirely a Javascript functionality.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

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