How to hide those empty fields on Drupal webform

Author: Hemanth | Posted: 13.08.2012

Drupal webforms are great a way to create custom form in very short time. It let you post the results via email and it is also helps to conduct a poll or to receive feedbacks from your users. When you submit the webform, it displays all the submitted values on the next screen by default; it provides a view of the submitted values. Webform displays all the values along with the labels. If a field has a value of 0 (zero), then those fields only have labels on submission screen. These empty fields can be hidden by adding a condition in the files that are located at webform/components/ directory.

So, let’s have a look at how to do this with a number of fields in Drupal 7

First go to directory webform/components/ and then open number.inc.

Find _webform_display_number function

Now, rewrite the code as follows:

Doing this will hide the numeric fields if they do not have a value on submission page.

You can add this condition for other field types as well. You are required to look for function pattern _webform_display in all the files in components directory

Hope you find it useful for your use case. For any further clarification or any kind of assistance related to your website, please contact Valuebound!

Valuebound is a leading Drupal Development Company providing Enterprise Drupal web solutions. For more information on Drupal Development, contact us at info@valuebound.com

About Author:
Visit The Source Article: http://www.valuebound.com/blog/how-hide-those-empty-fields-drupal-webform

Article was printed from http://www.articleside.com/web-design-articles/how-to-hide-those-empty-fields-on-drupal-webform.htm
Click here to return original format