11-13-2024, 02:35 AM
(11-11-2024, 07:30 AM)iwuser Wrote: There are many examples of the reverse, but none that gives you ability to call a JS function on a page from Pascal. Is it possible?
For instance, I want to submit a form. Which I have just dynamically created on the page.
I know that if I add some OnLoad JS somewhere and click some button synchronously, it would re-render the form, execute that OnLoad function and this can submit my form, but I'm trying to avoid reloading the form, I want the buttons to work asynchronously, so there will be no reload and any OnLoad events there would not fire.
TIWButton should have a OnAsyncClick event.
To call JS function from Pascal, this should work
WebApplication.ExecuteJS('javascript goes here');
or
WebApplication.CallbackResponse.AddJavaScriptToExecute('javascript goes here');

