Javascript and jQuery

Javascript and jQuery

Hi, folks.

How to properly add simple javascript (or better something that written on JQuery) to Webscreen and does it different from add javascript to webblock?
For example, I have an input box and I want to format it input like here:
 tried to add JQuery as wirtten here:, but I don't have AddJavascriptTag action (maybe I search it in wrong place?), then I try this: but nothing changed. 
Then I decide to use simple javascript. Write this function at webblock javascript filed:

function numFormat(n, d, s) {
	if (arguments.length == 2) { s = " "; }
	if (arguments.length == 1) { s = " "; d = "."; }
	n = n.toString();
	a = n.split(d);
	x = a[0];
	y = a[1];
	z = "";
	if (typeof(x) != "undefined") {
	for (i=x.length-1;i>=0;i--)
		z += x.charAt(i);
	z = z.replace(/(\d{3})/g, "$1" + s);
	if (z.slice(-s.length) == s)
		z = z.slice(0, -s.length);
	x = "";
	for (i=z.length-1;i>=0;i--)
		x += z.charAt(i);
	if (typeof(y) != "undefined" && y.length > 0)
		x += d + y;
	return x;

And gived name to inputbox, for example "InputBoxName", then I changed value of property "onkeypress" of inputbox to "numFormat(InputBoxName);" and nothing changed, also I tried "return numFormat(InputBoxName);" like here: and nothing changed. 
Additional information: in webblock I've got a table with entities and this inputbox filled by data of entities on preparetion (so, I've got a lot of input boxes), also I've got an OnChange screen action, I'm using OutSystem Agile Platform 6.0

What I should to do? Or what i do wrong?
can you provide a simple oml with how you did it?

furthermore, check with firefox -> error console if there are errors.

Sorry for my long responce, I was without internet on weekends. This is an example app.
No problem.

my first question is, what you want to do exactly?

I see the onchange with a return NumFormat, but that is about it.
you are not filling anything with the changed result.

what I expected was something like:

var x = numFormat(someId); //format the data
document.getElementById(someId).value = x; //overwrite the current data with the formatted data