You are here

function weather_es_form_validate in Weather_es 7

Same name and namespace in other branches
  1. 6.3 weather_es.module \weather_es_form_validate()

@author jmsirvent

2 string references to 'weather_es_form_validate'
weather_es_edit_form in ./weather_es.module
@author jmsirvent
weather_es_modify_form in ./weather_es.module
@author jmsirvent

File

./weather_es.module, line 388

Code

function weather_es_form_validate($form, &$form_state) {

  // If there's AHAH sent, that's only the combo
  if (!empty($form_state['ahah_submission'])) {
    return;
  }

  //if ($form_state['values']['combo']['ciudad'] == '0' OR !in_array($form_state['values']['idioma'], array('es', 'ca', 'gl', 'eu', 'en', 'fr'))) {
  if (isset($form_state['values']['combo']['provincia']) && $form_state['values']['combo']['provincia'] == '---') {

    //form_set_error('ciudad', t('You must select a valid city and language.'));
    form_set_error('combo][provincia', t('You must select a valid province.'));
  }

  //if ($form_state['values']['combo']['ciudad'] == '00') {
  if (empty($form_state['values']['combo']['ciudad'])) {
    form_set_error('combo][ciudad', t('You must select a valid city.'));
  }
  if (count(array_filter($form_state['values']['informacion'])) == 0) {
    form_set_error('informacion', t('You must select at last one information type to show it.'));
  }
}