help with mathematics

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Arnora
Forum Newbie
Posts: 6
Joined: Mon Sep 13, 2010 3:29 am

help with mathematics

Post by Arnora »

HI all

Please take a look at the below table rows.
Ideally I would like to know how I can efficiently multiply the results (user selection * user entered quantity)
now have I made this too difficult for myself? Is there a simpler way to do it? Yet again I feel I have bitten off more than I can chew.

[text]<tr>
<td width="50%" scope="col" align="left">Carpets</td>
<td width="20%" scope="col" align="center">Quantity*</td>
<td width="30%" scope="col" align="left">Price**</td>
</tr>
<tr>
<td colspan="3"><hr></td>
</tr>
<tr>
<td align="left"><label>
<input type="checkbox" name="Carpets" value="Kitchen" id="Carpets_0">
Kitchen</label></td>
<td align="center"><label for="Carpets_0"></label>
<input name="Kitchen" type="text" id="Carpets_0" size="4" maxlength="4"></td>
<td align="left">£30.00</td>
</tr>
<tr>
<td align="left"><label>
<input type="checkbox" name="Carpets" value="Bedroom" id="Carpets_1">
Bedroom</label></td>
<td align="center"><label for="Carpets_1"></label>
<input name="Bedroom" type="text" id="Carpets_1" size="4" maxlength="4"></td>
<td align="left">£30.00</td>
<tr>[/text]

Thank you in advance for any help you can give me here.

Arnora
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: help with mathematics

Post by McInfo »

Are the checkboxes necessary? Relying only on quantity inputs with default values of zero might simplify things.
crazycoders
Forum Contributor
Posts: 260
Joined: Tue Oct 28, 2008 7:48 am
Location: Montreal, Qc, Canada

Re: help with mathematics

Post by crazycoders »

Your question doesn't seem to have anything to do with PHP, it seems to be a client side problem regarding javascript interraction with the user.

Am i right?
Arnora
Forum Newbie
Posts: 6
Joined: Mon Sep 13, 2010 3:29 am

Re: help with mathematics

Post by Arnora »

McInfo wrote:Are the checkboxes necessary? Relying only on quantity inputs with default values of zero might simplify things.
This does seem like a better aproach I'll try this out and let you know. Thank you.

Arnora
Post Reply