Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

vehicle number formik validation

Yup.string()
      .required("Vehicle Number is Required")
      .test(
        "vehicleNumber",
        "First two letters of the vehicle number should be capitalized and followed by a space, then the vehicle number should be in the format of 'AB 1234' or 'AB 1234 CDE'",
        (value) => {
          return /^[A-Z]{2}[ -][0-9]{1,2}(?: [A-Z])?(?: [A-Z]*)? [0-9]{4}$/i.test(
            value
          );
        }
      ),
Comment

PREVIOUS NEXT
Code Example
Javascript :: event handling in react documentation 
Javascript :: change form action js 
Javascript :: jquery change value of input 
Javascript :: replace node 
Javascript :: function expression and function declaration 
Javascript :: javascript open in new window not tab 
Javascript :: cypress set viewport for all test cases 
Javascript :: json parse error: cannot deserialize value of type `java.time.localdate` from string 
Javascript :: js is number 
Javascript :: clear canvas 
Javascript :: classlist remove all classes 
Javascript :: check if input is touched react 
Javascript :: javascript copy an array 
Javascript :: select random from an array 
Javascript :: ExpressionChangedAfterItHasBeenCheckedError: 
Javascript :: cancel settimeout 
Javascript :: How to iterate over the DOM 
Javascript :: check if variable is undefined or null jquery 
Javascript :: how to get file size in node js 
Javascript :: avascript sleep 1 second 
Javascript :: how to find the last item in an array 
Javascript :: type of variable js 
Javascript :: javascript get unique values from key 
Javascript :: how to get current date in js 
Javascript :: execute JS code after pressing space bar 
Javascript :: sum javascript 
Javascript :: ajax delete laravel 
Javascript :: mock window jest js 
Javascript :: add id to html element javascript 
Javascript :: jquery datatables get selected row data 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =