You are here

function sharedblocks_subscribe_form_validate in Shared Blocks 6

Same name and namespace in other branches
  1. 7 sharedblocks.module \sharedblocks_subscribe_form_validate()

Validate callback for subscription block add/edit form.

File

./sharedblocks.module, line 257

Code

function sharedblocks_subscribe_form_validate($form, &$form_state) {
  $values = $form_state['values'];

  // Check for machine-readable name.
  if (preg_match('/[^0-9A-Za-z_]/', $values['name'])) {
    form_set_error('name', t('Your machine-readable name must be alphanumeric and underscore characters only.'));
  }
}