Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-19-2007, 09:32 AM   PM User | #1
nurvirus
New Coder

 
Join Date: Jul 2007
Location: malaysia
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
nurvirus is an unknown quantity at this point
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!
nurvirus is offline   Reply With Quote
Old 07-19-2007, 01:17 PM   PM User | #2
mcjwb
Regular Coder

 
Join Date: Jul 2007
Location: UK
Posts: 223
Thanks: 0
Thanked 14 Times in 14 Posts
mcjwb is an unknown quantity at this point
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?
mcjwb is offline   Reply With Quote
Old 07-20-2007, 02:17 AM   PM User | #3
nurvirus
New Coder

 
Join Date: Jul 2007
Location: malaysia
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
nurvirus is an unknown quantity at this point
i want the price to display straight away after i choose the product from the scroll down without any buttons.
nurvirus is offline   Reply With Quote
Old 07-20-2007, 04:02 AM   PM User | #4
rafiki
Senior Coder

 
rafiki's Avatar
 
Join Date: Aug 2006
Location: Floating around somewhere...
Posts: 2,034
Thanks: 18
Thanked 42 Times in 42 Posts
rafiki will become famous soon enough
yes javascript
__________________
Get Firefox Now
rafiki is offline   Reply With Quote
Old 07-20-2007, 04:16 AM   PM User | #5
nurvirus
New Coder

 
Join Date: Jul 2007
Location: malaysia
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
nurvirus is an unknown quantity at this point
ohh.. sorry i guess im in the wrong forum.. thanks btw!
nurvirus is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:52 PM.


Advertisement
Log in to turn off these ads.