Custom HTML Prompt Form Validation

HTML5 added form validation options. You can, for example, specify that an input field is an email address, a number, or a url or other things.

You can then automatically check the validation of the form before submitting using something like this in your Custom HTML Prompt’s HTML:

onclick="if ( document.getElementById('myform').checkValidity() ) { window.KeyboardMaestro.Submit('OK') } else { document.getElementById('myform').reportValidity() }"
3 Likes