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 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2007
    Location
    malaysia
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    scroll down menu



    hai, anyone knows how to display the price when scroll down the product list without clicking any button?
    the product list i take from database and the price also stored in database.. basically this is my coding..

    PHP Code:
      <table border="1" width="65%">
                            <tr bgcolor="#CCCCCC">
                                <td width="1%" align="center"><input type="checkbox" name="all" onClick="checkAll(document.pos.checkGroup,this)"></td>
                                <td width="1%" align="center">NO.</td>
                                <td width="3%" align="center">PRODUCT</td>
                                <td width="22%" align="center">UNIT PRICE</td>
                                <td width="22%" align="center">QUANTITY</td>
                                <td width="22%" align="center">TOTAL</td>
                            </tr>

                              <tr bgcolor="">
                                <td width="1%" align="center"><input type="checkbox" name="checkGroup" ></td>

                                <td width="1%" align="center"><? echo $number?></td>

                                <td width="3%" align="center">
                                <select class="standardselect" name="optProduct" ">
                              <option value="product" selected>--Select product--</option>
                              <?
                                 $aProduct 
    db_query(" SELECT * FROM product_ms WHERE product_display = 'Y' order by product_code ");

                                 if (!
    is_array($aProduct) )
                                 {
                                   echo 
    "<option value=''>no Product available</option>";
                                 }
                                 else
                                 {
                                   foreach (
    $aProduct as $rowProduct)
                                   {
                                    echo 
    "<OPTION VALUE=".($rowProduct["product_code"]).">".($rowProduct["product_desc"])."</OPTION>";
                                   }
                                 }
                               
    ?>
                            </select>
                                </td>

                                <td width="22%" name="price" align="center"">RM



                                </td>
    should i be using onkeyup? onchange?

    thank you in advance!

  • #2
    Regular Coder
    Join Date
    Jul 2007
    Location
    UK
    Posts
    223
    Thanks
    0
    Thanked 14 Times in 14 Posts
    This is really a javascript question.

    onchange will work.

    Do you want the price to be displayed straight away or are you going to submit the form and refresh the page?

  • #3
    New Coder
    Join Date
    Jul 2007
    Location
    malaysia
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i want the price to display straight away after i choose the product from the scroll down without any buttons.

  • #4
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    yes javascript

  • #5
    New Coder
    Join Date
    Jul 2007
    Location
    malaysia
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ohh.. sorry i guess im in the wrong forum.. thanks btw!


  •  

    Posting Permissions

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