tags:

views:

8

answers:

0

I have one button and onclick i want javascript function to be called which contains alert message...............in drupal

i tried many things like........... 1)i created button using
$form['click'] = array( '#type' => 'button', '#attributes' => array('onclick' =>_____),//dnt know what to give for onclick '#value' => t('click'), );

2)used drupal_add_js(drupal_get_path('module', 'document').'/eg.js', 'module');in hook_form_alter()

3).js file is as follows function message() { alert("Catch ->This alert box was called"); } -->

want alert message to be displayed on button click. Kindly help................ Thanks in advance