Math calculation of checkbox values on the same page
Posted: Tue Jul 20, 2004 10:13 am
Intro:
I have a form, and PHP_SELF command
I have 3 checkboxes
<input type="checkbox" name="check1" value="25">
<input type="checkbox" name="check2" value="20">
<input type="checkbox" name="check3" value="15">
As you noticed VALUE field is different
And PHP code
GET for each of these
$value1='';
$value2= $check1 + $check2 + $check3;
The Problem:
I need the script to add values of any checked checkboxes on the page BUT also to present it on the same page (is it possible without loading the page again and loosing whats checked and what not)
Ex:
check1 (I checked it)
check2 (I checked it)
check3 (Not checked)
Output on the same page should be 45, but also the checkboxes that are checked should remain checked.
Thanks Ahead !
I have a form, and PHP_SELF command
I have 3 checkboxes
<input type="checkbox" name="check1" value="25">
<input type="checkbox" name="check2" value="20">
<input type="checkbox" name="check3" value="15">
As you noticed VALUE field is different
And PHP code
GET for each of these
$value1='';
$value2= $check1 + $check2 + $check3;
The Problem:
I need the script to add values of any checked checkboxes on the page BUT also to present it on the same page (is it possible without loading the page again and loosing whats checked and what not)
Ex:
check1 (I checked it)
check2 (I checked it)
check3 (Not checked)
Output on the same page should be 45, but also the checkboxes that are checked should remain checked.
Thanks Ahead !