diff --git a/Zebra_Form.php b/Zebra_Form.php
index ddccd6d..04f887e 100644
--- a/Zebra_Form.php
+++ b/Zebra_Form.php
@@ -517,7 +517,275 @@ function add_error($error_block, $error_message)
$this->errors[$error_block][] = trim($error_message);
}
+
+ /**
+ * Link error message to a spesific field same as clientside validation
+ *
+ *
+ * // create a new form
+ * $form = new Zebra_Form('my_form');
+ *
+ * // add a text control to the form
+ * $obj = $form->add('text', 'my_text');
+ *
+ * // make the text field required
+ * $obj->set_rule(
+ * 'required' => array(
+ * 'error', // variable to add the error message to
+ * 'Field is required' // error message if value doesn't validate
+ * )
+ * );
+ *
+ * // don't forget to always call this method before rendering the form
+ * if ($form->validate()) {
+ *
+ * // for the purpose of this example, we will do a custom validation
+ * // after calling the "validate" method.
+ * // for custom validations, using the "custom" rule is recommended instead
+ *
+ * // check if value's is between 1 and 10
+ * if ((int)$_POST['my_text']) < 1 || (int)$_POST['my_text']) > 10) {
+ *
+ * $form->add_error_to_field('my_text', 'Value must be an integer between 1 and 10!');
+ *
+ * } else {
+ *
+ * // put code here that is to be executed when the form values are ok
+ *
+ * }
+ *
+ * }
+ *
+ * // Link error message to a spesific field same as clientside validation
+ * $form->render();
+ *
+ *
+ * @param string $field_id The Unique name to identify the control where to attach the error block
+ *
+ * @param string $error_message The error message to append to the error block.
+ *
+ * @return void
+ */
+ function add_error_to_field($field_id,$error_message)
+ {
+ echo "";
+ }
/**
* Set the server path and URL to the "process.php" and "mimes.json" files.
*
@@ -4946,4 +5214,4 @@ function _zebra_form_show_error($message, $type)
}
-?>
\ No newline at end of file
+?>