Function SET187B Handle Enter Key using javascript

LANSA

Function SET187B Handle Enter Key using javascript

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_187A);
********** COMMENT(Function .......: SET187B);
********** COMMENT(Created on .....: 26/07/00 at 14:43:32);
********** COMMENT(Description ....: Handle the Enter key in Browsers (1));
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(show one way of handling the problem when the user);
********** COMMENT(presses enter. In this method, a warning message is);
********** COMMENT(issued when the user presses enter. The warning message);
********** COMMENT(instructs the user to press a button on the form);
********** COMMENT(instead of pressing enter on the keyboard.);
********** COMMENT();
********** COMMENT(This is achieved with two modifications:);
********** COMMENT();
********** COMMENT(1. A HandleENTERKey function is added to the script);
********** COMMENT((either DEFAULT_SCRIPT or (as in this case) the);
********** COMMENT(process specific script (SET_187B_SCRIPT).);
********** COMMENT(function HandleENTERKey());
********** COMMENT({);
********** COMMENT(if (document.LANSA._PROCESS.value==" " || document.LAN);
********** COMMENT(SA._FUNCTION.value==" "));
********** COMMENT({);
********** COMMENT(alert("Form cannot be submitted using the ENTER button.);
********** COMMENT(Click on a BUTTON to submit."););
********** COMMENT(return false;);
********** COMMENT(});
********** COMMENT(else);
********** COMMENT({);
********** COMMENT(return false;);
********** COMMENT(});
********** COMMENT(});
********** COMMENT();
********** COMMENT();
********** COMMENT(2. After this function has been compiled, the);
********** COMMENT(generated HTML is edited and the line:);
********** COMMENT(<FORM NAME="LANSA" METHOD="POST");
********** COMMENT(ACTION="/<RDML MERGE="&CGI">/LANSAWEB?WEBEVENT);
********** COMMENT(+<RDML MERGE="&SESSPL">">);
********** COMMENT();
********** COMMENT(becomes:);
********** COMMENT();
********** COMMENT(<FORM NAME="LANSA" METHOD="POST");
********** COMMENT(ACTION="/<RDML MERGE="&CGI">/LANSAWEB?WEBEVENT);
********** COMMENT(+<RDML MERGE="&SESSPL">");
********** COMMENT(onSubmit="return HandleENTERKey()">);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT();
********** COMMENT(Receives: nothing);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT *WEBEVENT);
********** COMMENT();
********** COMMENT(Group and field definitions);
********** COMMENT();
OVERRIDE FIELD(#STD_COUNT) LABEL('Iteration');
********** COMMENT();
GROUP_BY NAME(#S_GRPPANL) FIELDS((#S_187FDES *INPUT *NOID)(#S_FUNDES *HIDDEN)(#STD_COUNT *INPUT)(#STDRENTRY *HIDDEN));
********** COMMENT((Field #S_187FDES has a component S_187FDES which);
********** COMMENT(merges in a component with the same name as the);
********** COMMENT(function (in this case component SET187B)));
********** COMMENT();
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
CHANGE FIELD(#S_FUNDES) TO(*FUNCTION_DESC);
********** COMMENT();
CASE OF_FIELD(#STDRENTRY);
WHEN VALUE_IS('= *BLANKS');
********** COMMENT(first time in);
CHANGE FIELD(#STDRENTRY) TO(Y);
CHANGE FIELD(#S_FUNDES) TO('''First time in''');
CHANGE FIELD(#STD_COUNT) TO(1);
WHEN VALUE_IS('= Y');
CHANGE FIELD(#S_FUNDES) TO('''Second or later iteration''');
CHANGE FIELD(#STD_COUNT) TO('#STD_COUNT + 1');
ENDCASE;
********** COMMENT();
REQUEST FIELDS(#S_GRPPANL) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);