Last updated November 11, 2012. Created on February 6, 2011.
Edited by densolis, colemanw, TommyK, tedbow. Log in to edit this page.

Webform 4

The features in this module are now included in Webform version 4. Therefore, the Webform Conditional module is no longer required if you are using Webform 4. However, the last version of Webform Conditional will automatically convert your exiting Webform Conditional settings directly into Webform 4.

When you upgrade to Webform 4, you should download and install Webform Conditional Version 7.x-2.x. This version will only run an upgrade during the Update.php process. Once this update has run, you can disable the module. See: #1616376: Create Migration to Webform 4.x for further information.

Once you have disable Webform Conditional Version 7.x-2.x, you should delete the module as you no longer need it. Inmotion hosting has a very good article which provides instructions for uninstalling a module in Drupal 7. Granted, it is specific to Inmotion, however the instructions only varies when you get to Step 8. The articles describes how to use cPanels to delete the module directory from their system. You will need to use the appropriate tool on your system to delete the Webform_conditional directory. For example, Windows uses Windows Explorer, Mac use the File Manager, and Ubuntu uses Nautilus.


Webform version 3 allows you to make Conditional Rules but a component can only be conditional on a component that appears in a previous page of the form. The Webform Conditional enhances the Webform module by enabling you to make a component conditional on a preceding component on the same page. You do this by adding a rule that list which values will cause the field to be hidden or displayed. If a fieldset is made conditional then all of the components inside the fieldset will be hidden if the fieldset is hidden.

Mutually exclusive conditional fields are not possible as it is. However, you can make a mutually exclusive options by adding a third select before them. This select will show one and hide another element and vice versa.

Module Dependency

This module is dependent on the Webform module.

User Documentation


Once the module is installed and activated, a Conditional Rules field group will appear at the bottom of each webform component's form. However, this option is only visible for fields that are placed after one of the following component types:

  • Checkboxes
  • Radio buttons
  • Or select lists

When you expand the Conditional Rules field group at the bottom of the component form, you will see the following three fields:

  • Component
  • Operator
  • Values


This drop down box will present a list of all of the valid component types (see above) that appear before the current component. (These components may or may not be on the current page.) From this list, you will select which component will be used determine whether to show or hide this component.


This drop down menu presents you with two choices; "is one of" and "is not one of". Remember, this conditional test is based upon the one or more values of the multi-valued components (see above list). Therefore, instead of using "equal to" and "not equal to", this module uses "is one of" and "is not one of" because you can set the condition based upon multiple values of the test component. The way to read this is if the conditional value:

  • is one of a or b or c or d, then this condition is true and the component will be displayed. If the condition is not true, then the component will be hidden.
  • is not one of a or b or c or d, then this condition is true and the component will be displayed. If the condition is false, then the component will be hidden.
  • It should be noted that we are testing the "safe key" or first value of the key value pair of the component you selected in the above "Component" drop down menu.

    For example, lets say you have a drop down menu component called "Age Range". It will ask the user to select their age range. And based upon their age, we will ask different questions or display different text. The values in the Age Range key pair list are:

    • key value = 1 and key option = Under 18
    • key value = 2 and key option = 18 to 25
    • key value = 3 and key option = 26 to 30
    • key value = 4 and key option = 31 to 40
    • key value = 5 and key option = 40 to 65
    • key value = 6 and key option = over 65

    Let's say that we will ask different questions if the user is under 18, or between the ages of 18 to 40, or over 40. In this case, you would have three different conditional fields. Their three conditional rules will be:

  1. If the value of Age Range is one of 1, then this first component would be displayed. Otherwise it would be hidden.
  2. If the value of Age Range is one of 2 or 3 or 4, then the second component would be displayed. Otherwise it would be hidden.
  3. If the value of Age Range is one of 5 or 6, then the third component would be displayed. Otherwise it would be hidden.

Since there is no overlap in the values, only one of the three conditional components would be displayed. We could also have over lapped the fields for which we are testing. For example, we could have added a fourth conditional field that would be displayed if the user was over 65. In this case, both the third and fourth conditional fields would have been displayed for someone over the age of 65.


As stated above, the values that should be in the list is the safe key from key value pair. Do not use the readable option from the key value pair as they will not work.

Also, each value must be entered by itself on a separate line. Do not put any separator such as a comma after each value. One of the main reasons a conditional test fails is because the values were not entered correctly.

Module Demonstrations

You can play with a working demonstration of this module at

And you can watch a screen cast which demonstrates how to add a conditional field to a web form.

Creating an issue

If you need assitance with a webform condtional issue, you can create an issue in the webform conditional issue queue.


If you have a Webform that does not work because of a bug in this module it is critical that you export of an example the Webform with this problem. The instructions are in the middle of the page. Without this export, it is extremely difficult to provide assitance.

Looking for support? Visit the forums, or join #drupal-support in IRC.


rkl27’s picture

Will this be made available for Webform for Drupal 7 anytime soon?

densolis’s picture

Yes, this module is curently available in Drupal 7. You can find it at the


madhukesh’s picture

Now it is curently available in Drupal 7.
You can find it at the webform conditional.

This module provide a simple way for show and hide web form field for corresponding to select list option values. Use following steps to integrate webform conditional with web form module.

1-First download webForm and webform conditional module in your system .
2-Extract both zip files.
3-Past these module in "sites/all/modules" folder in your drupal sites.
4-Now you Login in admin section and click modules menu tab.
5-Now you can found both module under WEBFORM module.
6-Enable both module(Install these module).
7-After enable these module you can found web form module Under "admin/structure/"(Structure menu) .
8-Now we create a webform form .Click "admin/content"(content) then click Add Content link and now click
Webform and fill the form title, body, and set your form setting according you at lest save your content and add your form field .

Note- Now we have created a web form . Lets come to set form field .

**************My Form name (Contact us)****************************

Field are- Subject
Order Number,

Show and hide form field corresponding to select list option value.

My subject field have two field "General Inquires " and "Order Inquires".

My goal is that when user select "Order Inquires" that time order number field show to user other wise it will
hide for "General Inquires" options.

It is very essay way to configure show and hide functionality.

when i creating Order Number field i am configure "Conditional rules" .i have putt value of Order Number in to Value field under Conditional rules.
This means that i am pass order_number value in Value field under Conditional rules.

Now Clear your All Caches .And Test this you found it's work .

When i select General Inquires option form show only two field Email, Message And when I select Order Inquires option Order Number, field will show in form

I hope this help you.