Validation Rules

Please check snapshot below to use this validaton methods.

  1. Required validation : When you need to make field required.
    Just tick required field in contact form 7 (Snapshot below)
  2. Email validation : When you need to validate email address.
    Just use Contact Form 7 email field
  3. Url validation : When you need to validate urls.
    Use class url. Validates : http://www.example.com
  4. Date validation : When you need to validate date.
    Use class date. Validates : 2015-03-12
  5. Number validation : When you need to validate only numbers.
    Use class number. Validates : 7645.46
  6. Digit only validation : Only accepts digits. No decimals accepted.
    Use class digits. Validates : 7645
  7. Credit Card validation : When you need to validate credit card number.
    Use class creditcard. Validates: 5520010511051954
  8. US Phone number validation : When you need to validate US Phone number.
    Use class phoneUS. Validates: 837-345-3456

Following validation methods are only available in Pro version.

  1. Minimum Number : Minimum numeric value user can input. Like: Age must be 18+.
    Use class JVmin-#. Where # is minimum numeric value required.
  2. Maximum Number : Maximum numeric value user can input. Like: Age mustt not be above 100.
    Use class JVmax-#. Where # is maximum numeric value required.
  3. Minimum Length : Minimum length user can input. Like: Name should be atleast 3 characters long.
    Use class JVminlength-#. Where # is minimum length required.
  4. Maximum Length : Maximum length user can input. Like: Name shouldn't exceed more than 30 characters.
    Use class JVmaxlength-#. Where # is maximum length allowed.
  5. Range Length : Minimum and maximum number of characters user can input. Like: username should atleast 3 and not more than 20 characters.
    Use class JVrangelength-#-*. Where # is minimum length required and * is maximum length allowed.
  6. Range : Minimum and maximum number value user can input. Like: Age should between 18 - 60.
    Use class JVrange-#-*. Where # is minimum numeric value required and * is maximum numeric value allowed.
  7. Equal To : When you need to ask same value similar to previous element. Like: Password Confirmation
    Use class JVequalTo-##########. Where ########## is the field name you want to tally with.
  8. JVextension : Only allow certain files format for user to upload. Like : jpg, png only. Use class JVextension-ext1_ext2_ext3. Where ext1, ext2, ext3 are the file extension you allow user to upload.
  9. JVrequireGroup : When given number of fields in a group need to be required. Like: Within a group of three phone numbers, ensure at least one is complete Use class JVrequireGroup-#_GROUPNAME. Where # is no of fields uses must fill up from the group and GROUPNAME is a field group name. Like: phonenumbers

Instructions
  1. You can add validation rules like url, date, dateiso, number, digits, creditcard, phoneUS from the class field of contact form 7. Check the snapshot below.