Hi, I'm new here and using PHP and I have this code...
All that I want is, one somebody click at one checkbox then, at the end this value be added (or substracted if unchecked)
How can I do that?
Please help...
- <?php
- function calcula($valor)
- {
- $total = $total + $valor;
- echo $total;
- echo "dime";
- }
- ?>
- <input type="checkbox" name="Book" id="Book" onclick="calcula(99.99);"/>
- <label for="Book">Add this for US$99.99</label>
- <input type="checkbox" name="DVD" id="DVD" onclick="calcula(15.35);"/>
- <label for="DVD">Add this for US$15.35</label>
- Add new comment
- 1 view