1

I have managed to get quite a few modules up and running and i'm now on my last sprint and got caught off guard by this small issue.

I simply want to change: if ($form_state['values']['search_block_form'] == '') { form_set_error('keys', t('Inserisci alcune chiavi di ricerca per cortesia')); }

however I cannot get my module to see my function. Here is the details Module: esos_search_form_language

Code:

<?php

function esos_form_alter(&$form, &$form_state, $form_id){
  if ($form_id == 'search_form'){
      $form['basic']['keys']['#title'] = 'Inserisci le tue chiavi di ricerca';
      $form['basic']['submit']['#value'] = 'Ricerca';
  }
  if ($form_id == 'search_block_form') {
      $form['search_block_form']['#default_value'] = t('Ricerca...');
  }
}

function esos_search_form_language_form_submit($form, &$form_state) {
  if ($form_state['values']['search_block_form'] == '') {
    form_set_error('keys', t('Inserisci alcune chiavi di ricerca per cortesia'));
  }
}

All of my code is working except the esos_search_form_language_form_submit function and I assume it is something really simple I am doing wrong. Can anyone help?

I tried using esos_search_form_language_submit, esos_submit as naming conventions too just in case it was that but with no luck.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.