Given below is the javascript code, which will let you do the thing you need.
function KeyDownHandler(e, btn)
{
var eventInstance = window.event ? event : e;
if (window.event)
{
if (eventInstance.keyCode == 13)
{
eventInstance.returnValue = false;
eventInstance.cancel = true;
var obj = document.getElementById(btn);
obj.click();
return false;
}
}
else if (eventInstance.which)
{
if (eventInstance.which == 13)
{
eventInstance.returnValue = false;
eventInstance.preventDefault();
eventInstance.cancelBubble = true;
var obj = document.getElementById(btn);
obj.click();
return false;
}
}
}
where e is the name of event, and btn is the id of button whose action you want to be performed(here it is your login button). Be sure to pass the client id of the button. Hope it will be helpful for you.
Anurag