Using Javascript function

  
hello all,
I'am a new bie , today i declared a javascript function in a webscreen , then i drag a new button in this webscreen.
All what i want is when a click the button , show perform my javascript function .
Please help me .
Thanks
Hi,
you can do that by draging the botton and in the extend properties set an on click function that triggers you function.



or you can define the button using javascript and use an expression with the escape content as No
something like this

Regards,

Carlos Rocha

EDIT: please notice that in the first image the property shlould be text... so I have miss the "" it should be

"functionNme(); return false;" instead of 
functionNme(); return false;
Thanks a bundle , best wishes for u
Very Good topic! It's help me alot!

Why you need put "return false" next to the function name?
Hi Gustavo,
You doesn't need to return false, but you need to return something...
Otherwise the screen action linked with the button will also be performed and this means that a submit will be performed cleaning all the javascript changes.

So If you want to perform same java script and also the screen action you just dont put any return. if you just want to execute the javascript you will need the return..

Regards,
Carlos Rocha
Good! Thank you very much...
Hi Carlos Rocha,

Could you please explain more about the javascript's return statements? and why it will clean all the javascript changes after the screen action is performed ?  In my case ,  I set the button Ajax Subimt, it did cleaned the javascript's changes but how can I keep the javascript's changes?

Thanks & Regards. 
In addition , when I do my ajax submit, I see the whole page is refreshing. It‘s amazing, could you please help me to analysis some reasons may cause this? thank you!
Carlos Rocha wrote:
Hi Gustavo,
You doesn't need to return false, but you need to return something...
Otherwise the screen action linked with the button will also be performed and this means that a submit will be performed cleaning all the javascript changes.

So If you want to perform same java script and also the screen action you just dont put any return. if you just want to execute the javascript you will need the return..

Regards,
Carlos Rocha
 Hi Carlos Rocha,

Could you please explain more about the javascript's return statements? and why it will clean all the javascript changes after the screen action is performed ?  In my case ,  I set the button Ajax Subimt, it did cleaned the javascript's changes but how can I keep the javascript's changes?

Thanks & Regards.