I
ian
Hi,
I am currently using a Javascript function to dissallow the enter key
on my ASP.NET (2.0) web page, as follows:
function fnTrapKP(){
if (document.all)
{
if (event.keyCode == 13)
{
event.returnValue=false;
event.cancelBubble = true;
}
}
}
I call this from the body of my master page as follows:
<body onkeypress="fnTrapKP();">
On one of my pages I have a multiline textbox. The function above now
stops a user from untering multiple lines of text in to this textbox.
Is there any way I can modify the function to only allow the enter key
to be allowed when my multiline textbox has the focus?
Thanks
Ian
I am currently using a Javascript function to dissallow the enter key
on my ASP.NET (2.0) web page, as follows:
function fnTrapKP(){
if (document.all)
{
if (event.keyCode == 13)
{
event.returnValue=false;
event.cancelBubble = true;
}
}
}
I call this from the body of my master page as follows:
<body onkeypress="fnTrapKP();">
On one of my pages I have a multiline textbox. The function above now
stops a user from untering multiple lines of text in to this textbox.
Is there any way I can modify the function to only allow the enter key
to be allowed when my multiline textbox has the focus?
Thanks
Ian