excelerondesign / whc

0 stars 0 forks source link

MODX/FormIt #24

Open gingerchew opened 4 years ago

gingerchew commented 4 years ago

MODX/FormIt example makes it easier for other people in the company to understand how to connect the frontend and backend aspects of this in the future

gingerchew commented 4 years ago

Here's what I used the most recent time:

[[!FormIt?
    &hooks=`...,captcha_verification,...`
    &captcha_difficulty=`[[*captcha-difficulty]]`
]]
<form action="[[~[[*id]]]]" method="POST" class="whc-form">
    ...
    <input 
        type="submit"
        name="submitIt"
        class="whc-button"
        data-finished="submit"
        value="verifying" />
    <!-- <input name="captcha_verification" value="..." /> inserted with JS -->
</form>
<script async defer id="whcScriptTag" data-button="whc-button" data-form="whc-form"></script>

and TV Options:

{
    "name": "captcha-difficulty",
    "caption": "Captcha Difficulty: A number 1-10",
    "description": "10 being the most difficult and taking the longest to verify",
    "options": {
        "inputTVtype": "number",
        "defaultValue": "3"
    }
}