cancel
Showing results for 
Search instead for 
Did you mean: 

Form field question

Former Member
0 Kudos

Hello Experts

I would like to find an example of how to get the ITS to send or process an OK Code at the R/3 backend when a field within a form is left by using the tab- or arrow-keys. This HTML template uses the down low standard html as an IAC with no other functions.

Any pointers will be aquited with a reward.

Thanks

Harry

Accepted Solutions (1)

Accepted Solutions (1)

ChrisSolomon
Active Contributor
0 Kudos

mmmm If I am following you, what you want is that when a user moves off (onBlur) or into (onFocus), you want to send and OKCode to the backend...correct?

You will need to modify your web page to trigger and javascript on your web page such as...

*code not EXACT syntax...just giving you the idea


<input type="text" name="SomeField" value="" onBlur="CheckField(this.name)">

<input type="text" name="AnotherField" value="" onBlur="CheckField(this.name)">

<script>
// This function will set the OKCode value
// based on the field we are checking and will do
// nothing unless the field is one we named to check
function CheckField(fieldName){
  if fieldName == 'SomeField' {
     MyForm.~okcode.value = 'SEARCH';
     CheckField = MyForm.submit;
  } else  if fieldName == 'AnotherField' {
     MyForm.~okcode.value = 'SKIP';
     CheckField = MyForm.submit;
  } else  {
     MyForm.~okcode.value = '';
  }
}
</script>

<form name="MyForm" action="`wgateURL()`" method="POST">
  <input type="hidden" name="~okcode" value="">
</form>

Then have you Javascript function (ie "CheckField" in above example) submit a form on your page that send the OKCode you want to the program. You can use a simple form with the OKcode as a hidden field....done it myself many times.

Now...the downside to this is that you do another round trip to the back.

Personally, I try to pull all the info I need from the back and then do what validations I can on the front end....like pulling a list of possible values from the backend and then check them on the front at input time to validate...I check again on the back "just in case" but having it done on the front usually catches it first (unless the user turns off Javascript for example).

Hope this helps.

Former Member
0 Kudos

Hello Christopher

Thanks for your example. I will rethink the idea and maybe take your advice in the last paragraph. Problem is that writing the checks in the backend is easier for me then in Javascript.

The reward points button did not work this morning. I will try again later.

Answers (0)