Supported Rules

  • required boolean required fields will be given a unique class you can use to mark the field as required. E.g:
.VF-Field--required label {
  position: relative;
}

.VF-Field--required>label:before {
  content:"*";
  font-size: 20px;
  color:red;
  position: absolute;
  left:-15px;
}
  • requiredIf string - make the field required only if another field was filled with a value (typically a select or checkbox). The field would only display when required. To set specific values for requiring the field use the following format:
    {
     field: {
       requiredIf:'otherField:val1, val2'
     }
    }
    
  • requiredAndShownIf string - same as requiredIf, except that the field is also hidden when it is not required.
  • email boolean - Automatically set to true for vf-email
  • number boolean - Automatically set to true for vf-number
  • min,max,between number -

    a. If the number or integer rules are set to true validates numeric values

    b. If the parameter is a moment object or a YYYY-MM-DD-formatted string validates dates

    c. Otherwise - validates string length

  • integer boolean
  • digits boolean
  • remote string Validate field on the server end. Accepts a URL, to which the value is sent on change event as a request parameter. Requires vue-resource
  • greaterThan,smallerThan string accepts the name of the compared field. Compares numbers and dates
  • url boolean
  • matches string The field under validation must match the specified field. The classic usage is password confirmation.

results matching ""

    No results matching ""