diff --git a/variable.form.inc b/variable.form.inc
index 4af480f..dca7ec2 100644
--- a/variable.form.inc
+++ b/variable.form.inc
@@ -20,12 +20,14 @@ function variable_form_element($variable, $options = array()) {
     $element = variable_form_element_default($variable, $options);
   }
   if (!empty($variable['validate callback'])) {
-    $element['#validate'][] = $variable['validate callback'];
+    $element['#element_validate'][] = 'variable_form_element_validate';
   }
   $element += array('#access' => variable_access($variable));
   if (!empty($variable['required'])) {
     $element += array('#required' => TRUE);
   }
+  // Add variable data to element so we can use it later fo validation, etc..
+  $element['#variable'] = $variable;
   return $element;
 }
 
@@ -148,6 +150,18 @@ function variable_form_element_options($variable, $options = array()) {
 }
 
 /**
+ * Implement validate callback
+ */
+function variable_form_element_validate($element, &$form_state, $form) {
+  $variable = $element['#variable'];
+  variable_include($variable);
+  $variable['value'] = isset($element['#value']) ? $element['#value'] : NULL;
+  if ($error = call_user_func($variable['validate callback'], $variable)) {
+    form_error($element, $error);
+  }
+}
+
+/**
  * Form to select variables
  */
 function theme_variable_table_select($variables) {
diff --git a/variable.variable.inc b/variable.variable.inc
index f9d7162..2cd0812 100644
--- a/variable.variable.inc
+++ b/variable.variable.inc
@@ -81,6 +81,7 @@ function variable_variable_type_info() {
   $type['number'] = array(
     'title' => t('Number'),
     'element' => array('#type' => 'textfield', '#size' => 15, '#maxlength' => 10),
+    'validate callback' => 'variable_validate_number',
     'token' => TRUE,
   );
   // Select multiple options from multiple choices
@@ -279,11 +280,18 @@ function variable_text_format_default($variable, $options = array()) {
   return $out;
 }
 
-
-
 /**
  * Format text_format.
  */
 function variable_format_text_format($variable, $options = array()) {
   return check_markup($variable['value']['value'], $variable['value']['format']);
+}
+
+/**
+ * Validate numeric variable.
+ */
+function variable_validate_number($variable) {
+  if (!is_numeric($variable['value'])) {
+    return t('The value is not a number.');
+  }
 }
\ No newline at end of file
diff --git a/variable_example/variable_example.variable.inc b/variable_example/variable_example.variable.inc
index 3c9e6d2..4cdc799 100644
--- a/variable_example/variable_example.variable.inc
+++ b/variable_example/variable_example.variable.inc
@@ -17,6 +17,15 @@ function variable_example_variable_info($options) {
     'required' => TRUE,
     'group' => 'variable_example',
   );
+  // Simple number, positive integer (demonstrates validate callback)
+  $variables['variable_example_number'] = array(
+    'type' => 'number',
+    'title' => t('Number', array(), $options),
+    'default' => 0,
+    'description' => t('Example of numeric variable.', array(), $options),
+    'required' => TRUE,
+    'group' => 'variable_example',
+  );
   // Text with format
   $variables['variable_example_text_format'] = array(
     'type' => 'text_format',
