I have a form build with the webform module. When text is entered in the input box in this case webform component 2 I want it to execute a ajax function and put data in a div. However this is not working at the moment. When i connect the ajax to $form['actions']['submit'] it does work.But i want it to be stuck to the input box not the submit function. The function is placed in the hook_form_alter.
$form['#node']->webform['components']['#ajax'] = array( 'callback' => 'callback function', 'wrapper' => '#foo', 'method' => 'replace', 'effect' => 'fade', );