I'm not sure I completely understand what you are trying to do here... Is the function clear_record() a PHP function? If that is the case you can not execute that function from an onClick event. The onClick event is a Javascript event, so you will need to use a Javascript function to trigger a remote PHP function. This can be done in a number of ways. You would use some sort of AJAX script, Javascript redirect (window.location=remote_url), or since you are using an input button you could simply submit the form to a remote PHP script.