NVal-Tippy is a wrapper for NVal and Tippy.js plugins that allows you to display validation errors in tooltips.
npm install nval-tippy
<script src="https://unpkg.com/nval@1.1.5/dist/browser/nval.min.js"></script>
<script src="https://unpkg.com/popper.js@1"></script>
<script src="https://unpkg.com/tippy.js@4"></script>
<script src="https://unpkg.com/nval-tippy@1.0.38/dist/browser/nval-tippy.min.js"></script>
import { NValTippy } from "nval-tippy";
// Pass the form element as an argument.
var validator = new NValTippy(document.getElementById("myForm"));
// Pass the form element as an argument.
var validator = new NValTippy.NValTippy(document.getElementById("myForm"));
validator.isValid(); // Returns boolean.
NValTippy object extends NVal. To configure validation use the official documentation for it.
Tooltip options are available by the public property tippyOptions
.
To configure tooltips use the official documentation for Tippy.js.