You are here

function block_country_form_validate in Block Country 7

Custom validate for block_country_form form.

1 string reference to 'block_country_form_validate'
block_country_form_alter in ./block_country.module
Implements hook_form_alter().

File

./block_country.module, line 136
Country_Block - Module for showing the country specific blocks.

Code

function block_country_form_validate($form, &$form_state) {

  // If checkbox is unchecked and no country is selected from the country_list,
  // then throw appropriate error message.
  if ($form_state['values']['block_visibility_country'] == 0 && empty($form_state['values']['country_code'])) {
    form_set_error('country_code', t('Select country field is required.'));
  }
}