lcollong
FabriKant d'applications web
Hi,
I have a search form with two checkbox elts. If I check something in both elements, the resulted url looks ok (elt1[value]=bar&elt2[value]=foo) and the list display the right results. But if one of the element hasn't any box checked, the resulted url shows "elt1[value]=&elt[value]=foo" which sounds good but the filtered result is not.
What I want to achieve in this particular case is : "whatever is elt1 value, show all the records with elt2=foo".
Or, in case the user doesn't check any box at all and click on "search", the result should be the list displaying all the records rather than an empty list.
I've tried both with or without appending "&resetfilters=1" on the url. Also tried to set a default value to the search form element without any success.
Ideally, the constructed url should not include "&eltx[value]=" if no box is checked.
Where am I wrong ?
I have a search form with two checkbox elts. If I check something in both elements, the resulted url looks ok (elt1[value]=bar&elt2[value]=foo) and the list display the right results. But if one of the element hasn't any box checked, the resulted url shows "elt1[value]=&elt[value]=foo" which sounds good but the filtered result is not.
What I want to achieve in this particular case is : "whatever is elt1 value, show all the records with elt2=foo".
Or, in case the user doesn't check any box at all and click on "search", the result should be the list displaying all the records rather than an empty list.
I've tried both with or without appending "&resetfilters=1" on the url. Also tried to set a default value to the search form element without any success.
Ideally, the constructed url should not include "&eltx[value]=" if no box is checked.
Where am I wrong ?