<Enter> key in a field

I am running Lotus Notes 6.0.3. I made a form for the web. On the form there are one edible field (‘text”) and one button (‘Submit’). The code in the button is simple:

FIELD text := “Test”;

main

When I press the button the text is visible (‘Test’) in the field. But if I write somthing in the field and press the key then the form will process. (Message:’Form processed’).

What I realy want is when I press key in the field then will the code in the button execute.

Is this possible?

Subject: key in a field

Hello,

You have to use Javasript. Attached a small samplecode for a searchpage:

function close()

{

alert (“****”);

}

function ToExecuteOnEnterName()

{

var pathname = window.location.pathname;

var searchstr = window.document.forms[0].LastName.value;

var viewstr = top.Picker_.document.forms[0].View.value;

var url = pathname.substring(0,(pathname.lastIndexOf(“.nsf”)+5))+ viewstr + “N” + “?OpenView” + “&StartKey=”+searchstr + “&View=” + viewstr +“N” + “&Count=400”;

top.liste_.location=url;

}

function ToExecuteOnEnterOrg()

{

var pathname = window.location.pathname;

var searchstr = window.document.forms[0].Orga.value;

var rsearchstr = searchstr.replace (“/” , " ");

var viewstr = top.Picker_.document.forms[0].View.value;

var url = pathname.substring(0,(pathname.lastIndexOf(“.nsf”)+5))+ viewstr + “O” + “?OpenView” + “&StartKey=”+rsearchstr + “&View=” + viewstr +“O” + “&Count=100”;

top.liste_.location=url;

}

function ToExecuteOnEnterDurchw()

{

var pathname = window.location.pathname;

var rsearchstr = window.document.forms[0].Durchwahl.value;

var viewstr = top.Picker_.document.forms[0].View.value;

var url = pathname.substring(0,(pathname.lastIndexOf(“.nsf”)+5))+ viewstr + “T” + “?OpenView” + “&StartKey=”+rsearchstr + “&View=” + viewstr +“T” + “&Count=100”;

top.liste_.location=url;

}

function ToExecuteOnEnterDurchw2()

{

var pathname = window.location.pathname;

var rsearchstr = window.document.forms[0].Durchwahl.value;

var viewstr = top.Picker_.document.forms[0].View.value;

var url = pathname.substring(0,(pathname.lastIndexOf(“.nsf”)+5))+ viewstr + “T” + “?OpenView” + “&StartKey=”+rsearchstr + “&View=” + viewstr +“T” + “&Count=100”;

alert(url);

top.liste_.location=url;

}

function KeyEvent(bez)

{

if (window.event.keyCode==13)

{

 if (bez=="LastName") ToExecuteOnEnterName();

 if (bez=="Orga") ToExecuteOnEnterOrg()

 if (bez=="Durchw") ToExecuteOnEnterDurchwahl();

}

}

return toExecuteOnEnter()