Showing results for 
Search instead for 
Did you mean: 

OnInputProcessing is called twice by using onclick!?

Former Member
0 Kudos


i ve following situation:

User can press ENTER or click on a button for submit a form. In order to run a javascript before running in oninputprocessing i m using an input field type button and the eventhandler onclick for clicking on the button, for ENTER I m catching the key code.

The problem is now that the oninputprocssing or submit is called twice if an event is fired. However the second time the eventid is empty. And that s the code:

<testscript fore=document event="onkeyupe()" language="JavaScript">





<testscript language="JavaScript">

function myHandler(c_id, in_name){

var key_code = window.event.keyCode;

if (key_code == "27"){;

} else if (key_code == "13" || c_id == "en"){

if (document.all.cursor_field.value == 'data-sped_date_input') {

var fn = document.all.cursor_field.value;

var x = document.getElementsByName(fn)[0].value;

var y = check_date(x);

if (false == y) {



document.getElementsByName(fn)[0].value = y;


if (key_code == "13"){

document.forms["myForm"].elements["we_event"].name = 'OnInputProcessing(ENTER)';


else {

document.forms["myForm"].elements["we_event"].name = in_name;






<input type="button" id="en" onclicke="myHandler('en', 'OnInputProcessing(ENTER)')" name ="Enter" size="02" value="Eingabe" CLASS="btn" />

Any ideas?


Accepted Solutions (0)

Answers (2)

Answers (2)

Active Contributor
0 Kudos

Try this code..Tested & working fine.,.

<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<s-cript t-ype="text/java-script">
function checkEnter(e,event_name){
var characterCode;
if(e && e.which){
event = event;
characterCode = e.which;
e = event;
characterCode = e.keyCode;

if (characterCode == 13)
document-getElementById("OnInputProcessing").value = event_name;

<html><form name = "mainform" >
<input type=text name="empno" value = "<%= empno %>" onKey-Press="checkEnter(event,'Display_User')">
<input type=submit name="onInputProcessing(Display_User)" value="Submit" >
<input type="hidden" name="OnInputProcessing" value="value"/>




Former Member
0 Kudos


I'm not sure it will helps, but, who knows?

What browser do you use? I know there are some browsers that trigger the submit form event when clicking an input field type button, so the form is submitted even if the Javascript doesn't do this. So maybe the submission is done twice because of that...

Good luck.