hey all,

I got this javascript code below which checks how much a user has typed in a mutli-line textbox if they reaach the link of 254 it doesnt allow them to continue which is correct.

</script>
<script language="javascript">

//these functions checks the length of data input if it is >255 then it will not allow user to continue
function CheckFieldLengthCus()
{
if(document.all('txtSecCusName').value.length > 254)
{
return false;
}
return true;
}

function CheckFieldLengthCode()
{
if(document.all('txtSecCusCode').value.length >254)
{
return false;
}
return true;
}

</script>

Now when i add this code which disables the buttons when the user hits the return key...

<script type="text/javascript">
//stop the buttons be activated when return is clicked.
function noenter() {
return !(window.event && window.event.keyCode == 13); }
</script>
<script language="javascript">

now if i had this code on body
<body onkeypress ="return noenter()">

it allows me to enter over 254 char into the textboxes (incorrect) but when i hit the return key it doenst call any of the buttons (correct) if i take the onkeypress out of the body , the char check javascript code works...but i would like to hve both...

does any1 have a solution plzzzz...