yadcf filter never null
yadcf filter never null
mbenci
Posts: 11Questions: 6Answers: 0
After the default value in yadcf (thanks for the great work done) now I have the necessity to have a filter that can't be null.
Is it possible to force one filter to have obligatorily a value?
Thanks and regards,
Marco B
This discussion has been closed.
Answers
You mean that you want your filter to act as a required field? is it in a form? you can always add a required="true" to it using js, explain your scenario....
SOme details;
I'm using the server side configuration and the yadcf plugins as filter mechanism.
I have some filter but one of these("year", the first one) can't be null otherwise the data shown have no sense.
Yes it must be a required filter but in yadcf as a I can click on reset button a new query starts (with "year" null).
Now the year filter has a dropdown menu with year values and "selected value" as options,
I'd like that if there is not value on the year filter nothing has to happen or that the filter "years" can't be null,
Thanks,
Marco B
you can remove the reset button with filter_reset_button_text: false (boolean false)
and you can remove the "select value" which reset the selection with a simple jquery command
(see what id your relevant select element has)
Thank you very much,
with these two configurations I obtain exactly what I want.
you are welcome.