Hi,

I created a form with select box (say "select_box1") and I would like to fill another select box ("select_box2") by data from DB when event "change" of select_box1 appear. I handled select_box event by AHAH code (because I using Drupal 5.12, I am using module AHAH Forms):

$form['language'] = array(
    '#type' => 'select',
    '#title' => t('Language'),
    '#options' => get_languages(),
    '#description' => t('Select the language.'),
    '#attributes' => array('style' => 'width:200px;', 'class' => 'language-array'),
    '#ahah_bindings' => array (
        array( 
            'event' => 'change',
  	    'path' => 'my/path',
  	    'wrapper' => 'target'
         )
    )
);

The function ahah_event_function correctly called

function ahah_event_function() {
   //to do st
   exit();
}

But what I need is to put same code that change the content of select_box2. I know how to do it with jQuery. I wrote this* function, but that function (if I can understand it) is called before ahah_event_function is called. What to do? :-).

thanks in advance, twardowski

*

// $Id$

if(Drupal.jsEnabled){
    $(document).ready(function() {
		$('select.terms-array').change(function() {
	        alert( "terms changed");
		});
	});
}