This is probably fairly straightforward, but I find myself constantly making boilerplate plugins like this. simple-validator is a small, opinionated validator that is useful for checking text in textboxes against external APIs.
This is helpful in the following flow:
- Given: an input textbox that may be validated (not required)
- Given: a "validate" button that may or may not be clicked before the user submits the form
- Given: a "validation message" span
- When: The user clicks the "validate" button.
- Then: The text in the input textbox is submitted to an external API via AJAX
- And: The results are printed to the "validation message" span