- Untitled
- Thursday, August 16th, 2007 at 2:58:53am MDT
- // HEY. i got this script that captures in textfield/textarea the key press and once the user press enter its submit the data and once he press esc its cancel it. the problem is that if the user presses enter in TEXTAREA its sends its instad of make a new line,,how can i slove it that if its textarea then dont use EIP_Cancel_Send_Data() function?
- function EIP_CaptureKeyCode(e,elementId) {
- var myKeyCode=0;
- // Internet Explorer 4+
- if ( document.all ) {
- myKeyCode=e.keyCode;
- // Netscape 4
- } else if ( document.layers ) {
- myKeyCode=e.which;
- // Netscape 6
- } else if ( document.getElementById )
- {
- myKeyCode=e.which;
- }
- if (myKeyCode == 27)
- {
- //case esc
- EIP_Cancel_Send_Data(elementId,27);
- return false;
- }
- if (myKeyCode == 13)
- {
- //enter key
- EIP_Send_Data(elementId,$('#<?=$this->GroupName?>'+elementId+'Text').val());
- return false;
- }
- return true;
- }
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.