Call Server Action with parameters inside Javascript Function

Hi ,

I found this topic: Executing a server action from within some custom javascript

I’m wondering how to do this to a server action with parameters.

Thank you

Something like this for static values:

dmx.parse("serverconnect1.load({param1: 'asdasd', param2: 'eerer'})");

Something like this if you want to pass values from a JS variable or something:

var x = 'hello';
dmx.parse("serverconnect1.load({param1: '" + x + "', param2: 'eerer'})");
3 Likes

Thank you

I Have it on onclick but it doesnt do anything,how to make it work. does it need to be in the page or the layout page? Can I putthe script in another js file then call it?

Wappler does not change how JS works. It can be inline, on page or external.
Please share some code that you are trying to run.