Use jQuery. Go to jQuery.com and and download the latest version. Include the jQuery javascript in your page and add the following script :
$("#yourtextboxId").keydown(function (event) {
if ((event.keyCode == '13') ||
(event.keyCode == '9')){
}
});
Easy as that!
BTW : Keycode 13 is for the return, and 9 is for the tab key