Ajax could be used, I would recommend reading up on working with Ajax and PHP and visit some tutorials to gain some experience first.
Then when you have trouble with working with Ajax and PHP, come back to ask a question and see if we can troubleshoot from there.
EDIT:
You could use Ajax for the showing/hiding the div, but thats about it. If you just need to create a non-trivial function and add up some values, you don't need AJAX, PHP can do that.
<?php
if (isset($_POST['submit'])) {
// only perform function if it was posted.
$listOfItems = $_POST['items']; // an array of selection.
$totalprice = 0;
foreach ($listOfItems as $list) {
$totalprice = $totalprice + $list; // calculate total price.
}
// perform more code here
}
<form action="<?=$_SERVER['PHP_SELF'];?>" method="post">
Your first item here <input type="checkbox" value="item1" name="items[]"><br />
Your second item here <input type="checkbox" value="item2" name="items[]"><br />
Your third item here <input type="checkbox" value="item3" name="items[]"><br />
</form>
?>