All Projects → jpetitto → Validator

jpetitto / Validator

Licence: apache-2.0
A tiny library for easily validating TextInputLayouts in Android

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Validator

Formr
Create and Validate PHP Forms in Seconds.
Stars: ✭ 163 (-3.55%)
Mutual labels:  validation, form-validation
Just Validate
Lightweight (~4,5kb gzip) form validation in Javascript Vanilla, without dependencies, with customizable rules (including remote validation), customizable messages and customizable submit form with ajax helper.
Stars: ✭ 74 (-56.21%)
Mutual labels:  validation, form-validation
Usetheform
React library for composing declarative forms, manage their state, handling their validation and much more.
Stars: ✭ 40 (-76.33%)
Mutual labels:  validation, form-validation
Hyperform
Capture form validation back from the browser
Stars: ✭ 729 (+331.36%)
Mutual labels:  validation, form-validation
Validator
A tool to validate text inside TextInputLayout
Stars: ✭ 117 (-30.77%)
Mutual labels:  validation, edittext
React Final Form
🏁 High performance subscription-based form state management for React
Stars: ✭ 6,781 (+3912.43%)
Mutual labels:  validation, form-validation
Lcformvalidation
Javascript based form validation library, third party library / framework agnostic.
Stars: ✭ 58 (-65.68%)
Mutual labels:  validation, form-validation
Bunny
BunnyJS - Lightweight native (vanilla) JavaScript (JS) and ECMAScript 6 (ES6) browser library, package of small stand-alone components without dependencies: FormData, upload, image preview, HTML5 validation, Autocomplete, Dropdown, Calendar, Datepicker, Ajax, Datatable, Pagination, URL, Template engine, Element positioning, smooth scrolling, routing, inversion of control and more. Simple syntax and architecture. Next generation jQuery and front-end framework. Documentation and examples available.
Stars: ✭ 473 (+179.88%)
Mutual labels:  validation, form-validation
Neoform
✅ React form state management and validation
Stars: ✭ 162 (-4.14%)
Mutual labels:  validation, form-validation
Bootstrap Validate
A simple Form Validation Library for Bootstrap 3 and Bootstrap 4 not depending on jQuery.
Stars: ✭ 112 (-33.73%)
Mutual labels:  validation, form-validation
Formsy React
A form input builder and validator for React JS
Stars: ✭ 708 (+318.93%)
Mutual labels:  validation, form-validation
Form Validation.js
The most customizable validation framework for JavaScript.
Stars: ✭ 127 (-24.85%)
Mutual labels:  validation, form-validation
Vue Form
Form validation for Vue.js 2.2+
Stars: ✭ 618 (+265.68%)
Mutual labels:  validation, form-validation
Ok
✔️ A tiny TypeScript library for form validation
Stars: ✭ 34 (-79.88%)
Mutual labels:  validation, form-validation
Nice Validator
Simple, smart and pleasant validation solution.
Stars: ✭ 587 (+247.34%)
Mutual labels:  validation, form-validation
Validation
Simple PHP helper class for Validation.
Stars: ✭ 46 (-72.78%)
Mutual labels:  validation, form-validation
Approvejs
A simple JavaScript validation library that doesn't interfere
Stars: ✭ 336 (+98.82%)
Mutual labels:  validation, form-validation
React Hook Form
📋 React Hooks for form state management and validation (Web + React Native)
Stars: ✭ 24,831 (+14592.9%)
Mutual labels:  validation, form-validation
Legit
input validation framework
Stars: ✭ 81 (-52.07%)
Mutual labels:  validation, form-validation
React Form With Constraints
Simple form validation for React
Stars: ✭ 117 (-30.77%)
Mutual labels:  validation, form-validation

Validator

Get easy error validation by swapping out TextInputLayout with ValidatingTextInputLayout:

<com.johnpetitto.validator.ValidatingTextInputLayout
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   app:errorLabel="@string/some_error">

   <EditText
       android:layout_width="match_parent"
       android:layout_height="wrap_content" />

</com.johnpetitto.validator.ValidatingTextInputLayout>

Then set a Validator on your ValidatingTextInputLayout:

layout.setValidator(new Validator() {
   @Override
   public boolean isValid(String input) {
       return input.startsWith("J");
   }
});

To validate, simply call validate() on the ValidatingTextInputLayout.

Validators provides a handful of predefined validators, including email and phone validation, which you can set with the app:validator tag. It also contains a helpful function for validating multiple ValidatingTextInputLayout objects at once.

For a more comprehensive introduction, refer to this blog post.

Download

compile 'com.johnpetitto.validator:validator:1.0.2'

License

Copyright 2017 John Petitto

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].