View Full Version : scroll down menu

07-19-2007, 10:32 AM

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..

<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 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>";
foreach ($aProduct as $rowProduct)
echo "<OPTION VALUE=".($rowProduct["product_code"]).">".($rowProduct["product_desc"])."</OPTION>";

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


should i be using onkeyup? onchange?

thank you in advance!

07-19-2007, 02:17 PM
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?

07-20-2007, 03:17 AM
i want the price to display straight away after i choose the product from the scroll down without any buttons.

07-20-2007, 05:02 AM
yes javascript

07-20-2007, 05:16 AM
ohh.. sorry i guess im in the wrong forum.. thanks btw!