pandiyan

pandiyan

  • NA
  • 106
  • 0

enter key press focuss button click

Feb 2 2009 5:31 AM

Hi,   

i have four textbox and one button. when i enter the enter key in textbox it focus to button click .i have use this code

function EnterKeyPressed(loginbutton)

{

if(event.which || event.keyCode)

{

if ((event.which == 13) || (event.keyCode == 13))

{

document.getElementById(loginbutton).click();

return false;

}

}

else

return true;

}

 

it is work in ie but not in ff and chrome.