rice-middleware/web/src/main/webapp/kr/scripts/core.js
/* script to prevent the return key from submitting a form unless the user is on a button or on a link. fix for KULFDBCK-555 */
script to prevent the return key from submitting a form unless the user is on a button or on a link. fix for KULFDBCK-555
script to prevent the return key from submitting a form unless the user is on a button or on a link . fix for KULFDBCK - 555
function isReturnKeyAllowed(buttonPrefix , event) {
    var elemType = event.srcElement ? event.srcElement.type : event.target.type;
    if (elemType != null && elemType.toLowerCase() == 'textarea') {
      return true;
    }
	var initiator = event.srcElement ? event.srcElement.name : event.target.name;
	var key = event.keyCode;
	if ( key == 13 ) {
		if( initiator == undefined || ( initiator.indexOf(buttonPrefix) != 0 && initiator.length > 0) ) {
		  return false;
		}
	}
    return true;
}
function isReturnKeyAllowed ( buttonPrefix , event ) { var elemType = event . srcElement ? event . srcElement . type : event . target . type ; if ( elemType != null && elemType . toLowerCase ( ) == 'textarea' ) { return true ; } var initiator = event . srcElement ? event . srcElement . name : event . target . name ; var key = event . keyCode ; if ( key == 13 ) { if ( initiator == undefined || ( initiator . indexOf ( buttonPrefix ) != 0 && initiator . length > 0 ) ) { return false ; } } return true ; }
script to prevent the return key from submitting a form unless the user is on a button or on a link.
script to prevent the return key from submitting a form unless the user is on a button or on a link .
/* use IE naming first then firefox. */ // KULEDOCS-1728: textareas need to have the return key enabled /* initiator is undefined check is to prevent return from doing anything if not in a form field since the initiator is undefined */ /* 13 is return key code */ /* length &gt; 0 check is to allow user to hit return on links */ // disallow enter key from fields that dont match prefix.