I need to output some javascript codes as well as form fields.
I am using Drupal 6 and form API to build the form. How can I output those javascript codes? Is there a 'javascript' type like textfield/checkboxes ?
I have tried the code below but string 'Array' is printed on the page instead of js code:
$form['target'] = array(
'#prefix' => '<div id="newuser">' ,
'#value' => drupal_add_js('alert("hello)','inline'),
'#suffix' => '</div>'
);