1

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

best

  • try what you want and if you have problem we help you accompolish it, try and dont give up :) – Yusef Sep 16 '12 at 14:48
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? – Fadi Fannoun Sep 17 '12 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 Sep 18 '12 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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