function IDMTextBoxKeyPress(e, btnID) { var k = e.which ? e.which : e.keyCode; if(k == 13) { if(btnID != '') { var btn = document.getElementById(btnID); var tagName = btn.tagName.toUpperCase(); if(tagName == 'INPUT') btn.click(); else if(tagName == 'A') document.location.href = btn.href; } return false; } else return true; }