Tag: Validation
Introduction In this example I am going to show you how to allow only numeric values or digits in input field using React JS. You may have a requirement where you only need to allow user digits or numeric values for the input field. If user inputs non-numeric values then either you show an error…
In this tutorial I am going to show you how to allow users only input numeric values or digits. If users enter non-numeric value then we will show an error message. We can also completely prevent from entering non-numeric values. In this case, we need to accept only numbers for a textbox or input field…
Introduction We will see how to validate a value is numeric or not in Python programming language. Situation may occur when you need to validate the input field’s value is numeric or not. The input field on the form may accept anything unless otherwise you have a client side validation. The user may input anything…
Introduction This tutorial will show you how to validate email address with regular expression using Kotlin. In this post, email validation in Kotlin will be done using regular expression or regex pattern. In web applications or standalone applications where we need to send emails to intended recipients, it is recommended to check the valid email…
This tutorial will show you how to solve HackerRank Valid Username Checker using Kotlin. In different web applications we define certain rules for choosing the username, such as, it should consists of maximum 30 characters; it should not have any special character; it may contain one or more digits; it must starts with a letter,…
In this example, I will show you how to build a bean validator for User model object.In my previous example, Spring MVC Custom Validator, I have shown how to validate user input. Validating input received from the user to maintain data integrity is an important part of application logic. The Bean Validation model is supported by…
Introduction In this example, I will show you how to build a custom validation (validator) for User model object. This validator is custom implementation of Validator interface. Spring MVC supports validation by means of a validator object that implements the Validator interface. I will write the below validator code in this example to check if…
Introduction Here I am going to tell you how to sanitize JSON (JavaScript Object Notation) string using Java program. Given JSON-like content, convert it to valid JSON. The OWASP JSON Sanitizer Project is a simple to use Java library that can be attached at either end of a data-pipeline to help satisfy Postel’s principle: be…