Willst du das im Frontend, Backend oder Web ersetzen? Im Web könnte sowas gehen:
var NS = (window.Event) ? 1 : 0;
function checkKey(e) {
var code = (NS) ? e.which : event.keyCode;
if (code == "13"){
HIER MUSS ERSETZ-CODE REIN
return false; }
}
document.onkeypress = checkKey;
oder nimm das hier:
*Offered freely by Darren J Semotiuk, Collaborative Learning Network Inc., http:////www.co-learn.net/ Just keep this comment line intact. Thanks! *
function replacestring(str_normal,str_find,str_replace,int_case_insensitive)
{
if (arguments.length<3 || str_find=="" || str_normal=="" ||
typeof("".split)!="function")
return(str_normal);
//no parm means default, "case SENSITIVE"...
if(!(int_case_insensitive))
return(str_normal.split(str_find)).join(str_replace);
str_find=str_find.toLowerCase();
var rv="";
var ix=str_normal.toLowerCase().indexOf(str_find);
while(ix>-1)
{
rv+=str_normal.substring(0,ix)+str_replace;
str_normal=str_normal.substring(ix+str_find.length);
ix=str_normal.toLowerCase().indexOf(str_find);
};
return(rv+str_normal);
};//end function replacestring