DEV Community

Cover image for Discover a Powerful Form Validation Library Without the Need for JavaScript Code
Claude Fassinou
Claude Fassinou

Posted on • Updated on

Discover a Powerful Form Validation Library Without the Need for JavaScript Code

Dive into the world of HTML validation with Trivule: a revolutionary library that automates and streamlines form validation without the need for JavaScript. Free yourself from the hassles of validation and focus on the core of your application, saving valuable time with every interaction with your forms.

Key Features:

  • Simple Installation: Get started in a flash with easy installation and initialization.
  <script>
    const tr = new Trivule();
    tr.init();
  </script>
Enter fullscreen mode Exit fullscreen mode
  • Code-Free Simplicity: Apply complex validation rules without ever touching a line of JavaScript. Trivule handles validation rules with ease.

    • Example:
  <input type="text" data-tr-rules="required|email">
Enter fullscreen mode Exit fullscreen mode
  • Validation Trigger: Trigger validation in real-time using a range of built-in or custom JavaScript events.

    • Example:
  <input data-tr-events="mouseenter|blur|my-custom-event" />
Enter fullscreen mode Exit fullscreen mode
  • Easy Customization: Style your form fields based on their validation status using CSS classes.

    • Example:
  <input type="text" data-tr-invalid-class="invalid" data-tr-valid-class="valid">
Enter fullscreen mode Exit fullscreen mode
  • Customized Messages: Enhance user experience by displaying tailored validation messages.

    • Example:
  <input type="text" data-tr-rules="required" data-tr-messages="This field is required.">
Enter fullscreen mode Exit fullscreen mode
  • Message Display Control: Specify where to display error messages for a field in case of validation failure.

    • Example:
  <input type="text" data-tr-feedback="input-name">
Enter fullscreen mode Exit fullscreen mode
  • Total Control: Master the behavior of your forms with advanced JavaScript functionalities.

Advanced Customization:

Explore a range of advanced features to meet your specific needs:

  • Custom Actions: Define actions to take based on the validation state of a field.

  • JavaScript Configuration: Interact with your forms autonomously and powerfully.

  • Custom Extensions: Add new validation rules for a tailored experience.

  • Multilingual Support: Personalize validation messages in multiple languages for a global reach.

Conclusion:

In summary, Trivule offers a wide range of intuitive attributes to configure and validate your forms effortlessly. Its simple installation and power make it the perfect tool to ensure the quality of your user data. Dive into the world of HTML validation with Trivule today and transform your web development experience.

Discover Trivule here

Top comments (0)