...

View Full Version : scroll down menu



nurvirus
07-19-2007, 09:32 AM
http://i12.photobucket.com/albums/a208/n_amalyna/product-1.jpg

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>

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

mcjwb
07-19-2007, 01: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?

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

rafiki
07-20-2007, 04:02 AM
yes javascript

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum