• Resolved evgenlow1980

    (@evgenlow1980)


    Hello! I need in onsubmit method on Javascript in AIO Forms. I was tried to call several variants, but all of them was wrong. I saw a sources of Javascript and see the BeforeSubmit method, but I couldn’t to insert a correct variant to call this method in Javascript configure plugin page and nothing worked. Can anybody to give me a hint, how to call beforesubmit method or onsubmit for the form of AIO Forms? Thank you very much.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    There was no easy way to do that but i just added a before submit event. You can register on it with a code like this:

    this.BeforeSubmit.Subscribe(null,()=>{alert(‘a’)})

    Regards!

    Thread Starter evgenlow1980

    (@evgenlow1980)

    Browser write this:

    Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘Subscribe’)
    at Di.eval (eval at ExecuteFirstCalculation (RNMainFormBuilderCore_bundle.js?ver=64:1:55686), :3:19)
    at Di.ExecuteFirstCalculation (RNMainFormBuilderCore_bundle.js?ver=64:1:55738)
    at o (RNMainRunnableForm_bundle.js?ver=64:1:1311)

    Thread Starter evgenlow1980

    (@evgenlow1980)

    this start working:
    let ex = [{BeforeSubmit : () => {alert(123)}}];
    this.SetAddOns(ex);

    Plugin Author EDGARROJAS

    (@edgarrojas)

    Oh did you updated the plugin? That feature was added in the release i just did yesterday.

    The code that you have although it works is kind of a ‘hack’ into the add-on mechanism (specially because you are adding a plain object and the add ons are expected to be objects that inherit from a class called RunnableAddOnLoader) so it is not guaranteed to work on future releases and it might break something else.

    Regards!

    Thread Starter evgenlow1980

    (@evgenlow1980)

    How call BeforeSubmit method, added in 1.2.157? My previous code working in previous version of plugin – 1.2.156. You added BeforeSubmit in 1.2.157. How call this method right?

    Plugin Author EDGARROJAS

    (@edgarrojas)

    You just need to put the code that i gave you in the javascript tab of your form:

    this.BeforeSubmit.Subscribe(null,()=>{alert(‘a’)})

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can I call BeforeSubmit in Javascript code on configure page?’ is closed to new replies.