You are here

function weather_custom_block_form_validate in Weather 5

Same name and namespace in other branches
  1. 5.6 weather.module \weather_custom_block_form_validate()
  2. 6.5 weather.module \weather_custom_block_form_validate()

Check the submission of the custom weather block

File

./weather.module, line 520
Display <acronym title="METeorological Aerodrome Report">METAR</acronym> weather data from anywhere in the world

Code

function weather_custom_block_form_validate($form_id, $form_values) {

  // do not validate for deletion action
  if ($form_values['op'] == t('Delete configuration')) {
    return;
  }
  if (_weather_get_country_from_icao($form_values['icao']) == '') {
    form_set_error('icao', t('The ICAO code is not valid.'));
  }
}