I created a view with Search API.Could you please help how to validate exposed filter(Textbox) with in a view.

I tried using contextual filter it never worked.

  • what do you mean by validate? what do you want to check? – Pax Sep 17 '13 at 19:06
  • I want to validate if exposed filters has only letters and numbers. – user21012 Sep 17 '13 at 20:34

I would alter the exposed form and add a validation handler.

If I remember correctly, the form ID is views_exposed_form. Just do a check on the view object (which I think is in the $form_state variable) to only add the handler to a certain view/view display.

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.