How to make a javascript function accessible in entire form?

I have some javascript code that is called onChange on 5 different fields. I can copy this code to the 5 javascript Onchange events, but of course I would like to put the code in a function/method/library somewhere.

How can this be done in a scriptcase application? (simple form).

Re: How to make a javascript function accessible in entire form?

Just create a JS function in PHP in your library section. In your events, call the function.
There are plenty of examples on calling JS:function from PHP that are online.

It is all just PHP/JS.

Regards,
Scott.

Re: How to make a javascript function accessible in entire form?

I want to call the function from a javascript event. Can I do that the same way you suggested?

Re: How to make a javascript function accessible in entire form?

I will have to try this before I say yes … or you could. <bg>

Regards,
Scott.

Re: How to make a javascript function accessible in entire form?

I got this suggestion from support. It’s not a nice one:

Jos? Arteiro: in oninit or onload php event, do you use command echo to white a javascript event.
Jos? Arteiro: example:
Jos? Arteiro:
echo "
<script>
function test() …
</script>
";

Re: How to make a javascript function accessible in entire form?

I figured as much. Call the php, that calls the JS.

Regards,
Scott.

Re: How to make a javascript function accessible in entire form?

Hi,
i’m new of scriptcase and php/js.

I have to create a PHP mathod that call a JS method and then I call the PHP method from my JS event (like onchange, etc…), right???

can you give me a little example for this calls ?

thank you
max