I check if one of two text inputs have text, using webshim, and think custom-validity sounds correct. http://afarkas.github.io/webshim/demos/demos/webforms/4-webforms-custom-validity.html
There is a method called addCustomValidityRule
that looks like this:
$.webshims.addCustomValidityRule('testname', function (elem, value) {
if (value && $(elem).hasClass('test-class') && value != 'foo bar baz') {
return true; //means yes, it's not valid
} else {
return false; //no, it is valid
}
}, 'you have to enter foo bar baz');
But I can't find any way to trigger it. How do I trigger or run it on "submit click"?