diff --git a/src/Form/UserNameValidationConfig.php b/src/Form/UserNameValidationConfig.php
index b42e3ee..21885d4 100644
--- a/src/Form/UserNameValidationConfig.php
+++ b/src/Form/UserNameValidationConfig.php
@@ -112,6 +112,32 @@ class UserNameValidationConfig extends ConfigFormBase {
    */
   public function validateForm(array &$form, FormStateInterface $form_state) {
     parent::validateForm($form, $form_state);
+    $min = $form_state->getValue('username_validation_rule')['min_char'];
+    $max = $form_state->getValue('username_validation_rule')['max_char'];
+    // Validate field is numerical.
+    if (!is_numeric($max)) {
+      $form_state->setErrorByName('max_char', t('These value should be Numerical'));
+    }
+
+    // Validate field should be between 0 and 256.
+    if ($max <= 0 || $max > 255) {
+      $form_state->setErrorByName('max_char', t('These value should be between 0 and 256'));
+    }
+
+    // Validate field is numerical.
+    if (!is_numeric($min)) {
+      $form_state->setErrorByName('min_char', t('These value should be Numerical'));
+    }
+
+    // Validate field is greater than 1.
+    if ($min < 1) {
+      $form_state->setErrorByName('min_char', t('These value should be more than 1'));
+    }
+
+    // Validate min is less than max value.
+    if ($min > $max) {
+      $form_state->setErrorByName('min_char', t('Minimum length should not be more than Max length'));
+    }
   }
 
   /**
