In magento 1.x we use the following code to validate Magento forms:
<script type="text/javascript">
var myForm= new VarienForm('contactstore', true);
</script>
I am using this code from the magento 2 contact form:
<div class="field email required">
<label class="label" for="email"><span>Email</span></label>
<div class="control">
<input name="email" id="email" title="Email" value="" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}" aria-required="true">
</div>
</div>
My question is: how do I validate a custom form in Magento 2?