• Resolved cichy

    (@cichy)


    Hi,

    I was searching for a solution on how to pass submission details and specifically the entry id into the Javascript callback function. I have found an article on calderawp describing how this can be done but the most important part (example) is missing for some reason.

    What I am trying to achieve is to pass entry id as an order id into the tracking code.

    I am able to call the javascript callback function with the tracking code inside of it on ajax submission but I don’t know how to get the value of entry id and pass it to the code.

    Would someone be able to help me with it?

    Thank you,
    Przemek

    https://ww.wp.xz.cn/plugins/caldera-forms/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter cichy

    (@cichy)

    sorry for spamming. I guess that my two previous posts were going through verification because of the URLs I’ve used.

    Plugin Author Josh Pollock

    (@shelob9)

    The object passed should have a key _entry_id, if you are tracking entries in that form.

    Thread Starter cichy

    (@cichy)

    Thank you very much for your reply. Could you please provide me with an example of a callback function that contains this object with key _entry_id?

    Plugin Author Josh Pollock

    (@shelob9)

    I was wrong. It is “cf_id” that has the entry ID. If you set the callback function to be “cf_submission_cb” then something like this should work:

    <script>function cf_submission_cb( obj ) { console.log( obj.data); alert( obj.data.cf_id ) }</script>

    Thread Starter cichy

    (@cichy)

    It works. You’re a great 🙂 Thank you very much for that. This feature is also great 😉

    Hi Josh,
    something strange is going on. I cannot access the data object, because for some reason, it is populized like this:
    Object { amp;cf_id: “70”, amp;total: “1190.00”, amp;veranstaltung: “Schwierige Prüfgespräche souverän m…”, amp;termin: “07.12 – 08.12.2016”, amp;event_id: “12H5239” }

    why ist there an “amp;” before every name?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Javascript callback function :: how to create object with submission details’ is closed to new replies.