Last active
January 26, 2017 13:36
-
-
Save thenoseman/8d70303b5262813f23c8cfbb021d88ea to your computer and use it in GitHub Desktop.
Form-O-Fill : Reading the runtime state in before functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rules = [{ | |
"name": "The default rule", | |
"url": "https://form-o-fill.github.io/tutorial/tour-1.html", | |
"autorun": true, | |
"before": function(resolve, context) { | |
console.warn("Rule manually triggered? %s", context.state.ruleManuallyTriggered); | |
console.warn("Rule automatically triggered? %s", context.state.ruleAutomaticallyTriggered); | |
console.warn("Rule part of workflow? %s", context.state.ruleRunningInWorkflow); | |
resolve(); | |
}, | |
"fields": [{ | |
"selector": "input[type=text]", | |
"value": "Welcome!" | |
}] | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment