uc_store_validate_uc_quantity

  1. ubercart
    1. 7.3
Versions
7.3 uc_store_validate_uc_quantity(&$element, &$form_state)

Form element validation handler for #type 'uc_quantity'.

Code

uc_store/uc_store.module, line 488

<?php
function uc_store_validate_uc_quantity(&$element, &$form_state) {
  if (!preg_match('/^\d+/', $element['#value'])) {
    form_error($element, t('The quantity must be a number.'));
  }
  elseif (empty($element['#allow_zero']) && !$element['#value']) {
    form_error($element, t('The quantity cannot be zero.'));
  }
}
?>