Getting headach with confirmation script and passing value with type=image button

Hi,
I can make a confirmation script redirected to the a page I need with the script bellow, but the variables I want to carry out with it do not pass. How do I solve this problem.


<script type="text/javascript">
<!--
	function confirmation() {
		var answer = confirm("Are you sure you want to delete the item?");
		if (answer){
			alert("Removing the item!");
			window.location = "delete.php";
			return true;
		} else {
			alert("Some items worth keeping!");
			return false;
		}
	}
//-->
</script>					
<form method='post'>
	<input type='hidden' name='id' value='<?php echo $row['id']; ?>' />
	<input type='hidden' name='name' value='<?php echo $row['name']; ?>' />
	<input type='image' src='images/delete.png' onclick='confirmation(); return false' title='delete item' />
</form>

Thanks so much

Supply the form with an action page, and then use the form’s onsubmit event to handle the confirmation process. You can cancel the submission by returning false back to the onsubmit event.

Thanks Paul,

I get the picture now. Very appreciated.