Might depend on what you mean by "cancel".
If its "restore the form to the state it was in when the page loads" youre looking for the straight html RESET in the form. <input type=reset> This in effect is often named "abandon changes" or similar.
If thats not what you mean but some other "go back" action, well its either go back to the server and do a "Header : Location ..." php redirect, or if a JS history.go(-1) type of thing which you'll find in the JS forum I guess..
Else what do you want cancel to do exactly?