Load JS only on specific content_type node creation Drupal 6. What is the proper way to execute drupal_add_js only when specific content_type is being created?

I have some jQuery code that needs to execute only to control some form elements in a specific content_type creation.
you need to write a simple module where you hook into the page you need and add drupal_add_js()

e.g. when you create a content type the form node_type_form is being called. so you have to hook into the form with

/**
 * implimentation of hook_form_alter()
 */
yourmodulename_form_node_type_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });','inline');
}


I asume you need to add a JS to a content_type being viewed. in this case you will need to use hook_view() :

/**
 * implimentation of hook_view()
 */
yourmodulename_view($node) {
    if ($node-&gt;type == "your_type") {
        drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });','inline');
    }
}


Update:

of course you can modify your template.php in the theme directory as well. remember that the theme for administration is different than the site theme by default. be aware which template.php file you are changing.