You are here

function hosting_quota_numeric_value in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 quota/hosting_quota.module \hosting_quota_numeric_value()
  2. 7.3 quota/hosting_quota.module \hosting_quota_numeric_value()

Validate that quota values are numeric

1 string reference to 'hosting_quota_numeric_value'
hosting_quota_form_alter in quota/hosting_quota.module
Insert edit controls for the hosting quotas into the client edit form

File

quota/hosting_quota.module, line 337
Implement quota's for the resource used by client.

Code

function hosting_quota_numeric_value($form, $form_state) {
  foreach ($form_state['values'] as $key => $value) {
    if (substr($key, 0, 5) == 'quota' && !is_numeric($value)) {
      form_set_error($key, 'You must set a number as a quota value!');
    }
  }
}