Code JavaScript:
<script type="text/javascript"><!--
if (document.getElementById("deletethisfile") || document.getElementById("deletethisfile") != null || document.getElementById("deletethisfile") != "undefined") {
function ondeleteclick() {
	if  (document.getElementById('deletethisfile').checked == true) {
		return window.confirm("Are you sure to delete this?");
		} 
	}	
} else if (!document.getElementById("deletethisfile") || document.getElementById("deletethisfile") == null || document.getElementById("deletethisfile") == "undefined") {
function ondeleteclick() {
	return true;
	}
}
//--></script>

And then I'm calling onsubmit="ondeleteclick()" with the opening form tag.

The idea is, if someone has checked the chekbox deletethisfile before hitting the submit, he gets a confirmation box. It's not working, I mean, no confirmation box is coming on submit even when the check box is selected.

I appreciate your time.
Thanks.