Hook Examples

  • Form.Content.HtmlBlock
  • Form.Content.ThankYouMessage
  • Form.Event.Submit

Form.Content.HtmlBlock

Let’s assume you want to change the color of a HTML block, and use a random color. You can do this easily with the following Hook:

You can see a live demo here. For the text to get the random color, the Hook receives the following Input, and displays the Output:

INPUT:
{
    "hook": {
        "hookName": "Rm9ybS5Db250ZW50Lkh0bWxCbG9jaw==",
        "userId": "MQ==",
        "formId": "NDEwMDI2Ng==",
        "formName": "SG9va3MgRGVtbyAtIFJhbmRvbSBjb2xvcg=="
    },
    "request": {
        "s": "NDEwMDI2Ng=="
    },
    "context": {
        "ip": "ODYuMTI1LjExNS4yMjg=",
        "controlId": "NDQwNDM3NzA="
    },
    "params": {
        "content": "PHAgc3R5bGU9InRleHQtYWxpZ246IGNlbnRlcjsiPjxzcGFuIHN0eWxlPSJmb250LXNpemU6IDE4cHQ7Ij5IZWxsbywgaXMgaXQgbWUgeW91J3JlIGxvb2tpbmcgZm9yPzwvc3Bhbj48L3A+"
    }
}
OUTPUT:
{
    "hook": {
        "hookName": "Rm9ybS5Db250ZW50Lkh0bWxCbG9jaw==",
        "userId": "MQ==",
        "formId": "NDEwMDI2Ng==",
        "formName": "SG9va3MgRGVtbyAtIFJhbmRvbSBjb2xvcg=="
    },
    "request": {
        "s": "NDEwMDI2Ng=="
    },
    "context": {
        "ip": "ODYuMTI1LjExNS4yMjg=",
        "controlId": "NDQwNDM3NzA="
    },
    "params": {
        "content": "PHNwYW4gc3R5bGU9J2NvbG9yOiNFRjUxRDknPjxwIHN0eWxlPSJ0ZXh0LWFsaWduOiBjZW50ZXI7Ij48c3BhbiBzdHlsZT0iZm9udC1zaXplOiAxOHB0OyI+SGVsbG8sIGlzIGl0IG1lIHlvdSdyZSBsb29raW5nIGZvcj88L3NwYW4+PC9wPjwvc3Bhbj4="
    }
}

You can try it yourself on your own forms. Here is the link that you should use for the Hook URL:
https://developer.123formbuilder.com/hooks-official-demos/random-color.php

Form.Content.ThankYouMessage

Let’s say you want to replace your default Thank You message, with one that contains a random discount code. You can achieve this easily with this Hook:

Form.Event.Submit

When a form is submitted, you can pass all the collected data to your desired page. This form passes, using Form.Event.Submit, all the data to this page (sample below):

{
  "hook": {
    "hookName": "Rm9ybS5FdmVudC5TdWJtaXQ=",
    "userId": "MQ==",
    "formId": "NDEwMDI2Ng==",
    "formName": "SG9va3MgRGVtbyAtIFJhbmRvbSBjb2xvcg=="
  },
  "request": {
    "s": "NDEwMDI2Ng==",
    "PHPSESSID": "MDBiOGplcmpkMDA1YmFjamFrYWlwMGFmcDU=",
    "newFormView": "MQ==",
    "action": "dmVyaWZ5",
    "go_back_and_edit": "MA==",
    "tmp_form_host": "aHR0cHM6Ly93d3cuMTIzZm9ybWJ1aWxkZXIuY29tL2Zvcm0tNDEwMDI2Ni8=",
    "tmp_referer": "",
    "sessionKey": "Y2ZyXzE1NTI5MTIxNTg4MjcuMTI1",
    "submXMLDatetimeStart": "MjAxOS0wMy0xOCAxMjoyOToxOA==",
    "language": "ZW4=",
    "control51538000-1": "Sm9obg==",
    "control51538000-2": "RG9l",
    "control51538000-3": "",
    "control51538000-4": "",
    "control51538000-5": "",
    "control51538001": "am9obmRvZUBleGFtcGxlLmNvbQ==",
    "hiddenfields": ""
  },
  "context": {
    "ip": "ODYuMTI1LjExNS4yMjg="
  },
  "params": []
}

Want to see more?