I need to add a checkbox in an exposed filter to strip left and right space of a value entered by user, i.e: I have email field on the basis of email filtering the user some time user add left or right extra space. I need a handler or plugins globally which is applied for all text field. If the somehow global implementation is critical so, on the specific field is also ok.

  • Sanjay welcome to stackexhange. Adding anything to any form requires most probably usage of hook_form_alter in a custom module. What have you done so far ? Question is not clear. What do you want happening after the form is submitted ? Please give example code that you have tried and example output you expect. – GiorgosK Mar 13 at 6:05
  • Thanks Giorgosk quick reply. Let me explain I have created a views for filter user on the basis of 'First name, Last name, Username, E-mail' etc. Now my requirement is if admin by mistake enter email id " test@gmail.com" or " test@gmail.com ", should be result come same as when I search with out space. So, I want to a checkbox in views globally through which is attached with textfield exposed filter i.e: title, email, first name, last name etc. If checkbox checked in views then space will be trim while search. I hope now the requirement is clear. If any please let me know. Thanks :) – Sanjay Mar 13 at 12:38
  • Please improve the actual question above with a clear example. – GiorgosK Mar 13 at 13:47
  • @GiorgosK I need a checkbox in highlighted area. If it's checked then we need to add trim in query and I need for textfield. Please have a look in screenshot drive.google.com/file/d/1gJR9zzD86OoPtmiF_Ksb-dof6N-Tmr8M/view. I need a checkbox same as 'Remember the last selection' option and it's available for all textfield. – Sanjay Mar 29 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.