2

I know i'm looking at this wrong and am running into a wall over and over again on this.

I have a view with an exposed filter in a block. I am looking to clear / reset the values in the block without reseting the view, so the default reset button in views doesn't cut it. Any Opinions?

2

I'm pretty sure that the better exposed filters module has an option for a reset button, but it may reset the view too.

You could also add some javascript that listens for the click event on the button and resets the fields you want.

0

Create a custom form , submit handler will execute some jquery codes to reset all form fields This link can be helpful for building such a form.

and in your views header add a php field and simply call the custom form with(mymodule_clear_filters is the name of function returning the custom form).

  print drupal_render(drupal_get_form('mymodule_clear_filters'));

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.