I have a content type called Car which have several field two of them are select lists which I want to make some operations on them. When the user select a value form the first select list a bulk of values should be populated in the other select list, my question is WHERE to do this programmatically and some tips for HOW doing this? I hope my question is clear


  • try what you want and if you have problem we help you accompolish it, try and dont give up :)
    – Yuseferi
    Commented Sep 16, 2012 at 14:48

1 Answer 1


You need to use hook_form_alter to add AHAH/AJAX to your field. The hook should be placed in either a custom module or in your theme's settings.php file.

Drupal has many examples about this. Here's for Drupal 6 and here's for Drupal 7.

This specific example from the links above seems to be what you are looking for.

  • thanks you dear hampusn, your answer seems to be very useful I will check this sol now, but I am wondering if there any ready module for this purpose? Commented Sep 17, 2012 at 9:31
  • The link I inserted at the bottom of my answer is an example which I believe gives you exactly what you want. It manipulates the second drop down based on what you choose in the first drop down. Please try to use that and we can help you if you get stuck.
    – hampusn
    Commented Sep 18, 2012 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.