Data loss using the <enter> key.

Question: I have a simple ITS app with 2 command buttons. It works fine if I hit either command buttion but if I hit hit the <enter> key all user entered data disappears. How can I force an okcode from the web app to associate with the <enter> key?

Answer:
You'll have to write a piece of Javascript to detect the enter key.

In the <body> tag enter the name of the function to run when the user press enter.

In the javascript function, enter the code for the enter key and what you want to happen. If you have different input fields, you can make it do different actions depending on what field you are in.

For Example

<head>
function checkKey() {
e = window.event;
switch (e.keyCode) {
case 13: //Enter pressed
if (document.activeElement == document.FORM.elements.FIELD) {
DoSomething();
break;
}
}
}

</head>
<body onKeyPress="checkKey()">

Hope that helps

James

Answer:
Can you post the html here?
Check,
- are all the <INPUT> fields inside the <FORM></FORM> tags
- what is the action="" and method="" attributes of the <FORM>
- what do the buttons do when you click them
- what does the URL say after you have pressed <ENTER> i.e. are the variables all there on the URL?
- where is the "~event=" parameter set?
_________________
Rgds,
Derek
_________________
For formal [onsite | telephone | IM | email] support on SAP Business Connector and ITS, please contact me directly
Copyright ?2007 - 2008 www.jt77.com