[SOLVED] PHP function execute in field?

Hello,
I’m a begginer at SC, so my question may sound a little silly, however… I’m making a form with AJAX Event onClick, that allows converting numbers to words. I want to display the amount of money in words in a specific field, so I’ve made an Event on this field. It looks like this:

sc_include(MyFunction.php);

$number={FieldWithNumbers};
echo MyFunction($number);

And here comes the issue. When I execute Event OnClick on my field, an output window with result of whole action appears. How can I manage displaying the result in a field, not in output window?
I’ve tried to resolve this on my own, but as I said, I’m really unexperienced.

Thanks in advance,

Anna

{YourFieldforText} = MyFunction($number);

Thank You very much!