Page 1 of 1

help with mathematics

Posted: Sun Feb 20, 2011 8:18 am
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

Re: help with mathematics

Posted: Sun Feb 20, 2011 8:17 pm
by McInfo
Are the checkboxes necessary? Relying only on quantity inputs with default values of zero might simplify things.

Re: help with mathematics

Posted: Mon Feb 21, 2011 3:45 pm
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?

Re: help with mathematics

Posted: Tue Feb 22, 2011 9:55 am
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