0

I want that a view shows its result only when users enter a value in the exposed form fields. Is there a way I can get this done?

I am using AJAX, and the view is displayed as block. Most of the options I tried don't work because of this.

0

2 Answers 2

2

For each of your fields, in your view, you have the option Hide if empty. Select it to not display anything for the field if it is empty. Note that the field label may still be displayed. Check style or row style settings to hide labels for empty fields.

1
  • sorry I think I was not clear enough. Let me try again. when the views is shown as a block using ajax the view executes the mysql and displays data which I don't want it do. I only want it to display data when a user submits his choice using the exposed filters. I did find this link which explains how to get it done but I can't seem to get it as I am using drupal 7 with views 3 drupal.org/node/358546
    – user845
    Apr 2, 2011 at 15:28
2

Because you run views for drupal7 there is already a build in solution.

Therefore change the "Exposed form style:" to "Input required" That's all you need.

Yeah pluggable systems!

1
  • GEzusss was it that simple ! I got it done but I had to some php code in it silly me i wish I knew this I would have saved an entire day
    – user845
    Apr 4, 2011 at 5:37

Your Answer

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