I m trying to make a form in Drupal where one of the dropdowns shows values depending on another one. In my case where I m making a form for some student program, I need to ensure that the options available for 'areas of interest' depend on the 'department' the user selects. Can anyone suggest a way to do th开发者_JS百科is. Anyways, I was using 'webform' module for this form.
You might want to try http://drupal.org/project/webform_conditional
I'm not aware of any drupal module that just has this "built in."
You need to use Javascript anyway, not PHP, as PHP is server side and cannot react to user input without page refresh.
Check out this dzone article for an example on how to do what you've described in javascript:
http://snippets.dzone.com/posts/show/4297
精彩评论