Clear all active refined search in once with a button

Hi,
anybody knows how to clear all active/selected refined search using a button and php code ?
Thanks

Giovannino-

This works with a Javascript button (not a PHP button). If your refined search fields are called myField1, myField2, myField3, then this code should do what you need:

// Clear all refined search selections listed below.
nm_proc_int_search(‘clear’,’’,’’,‘myField1’, ‘’, ‘myfield1’, ‘’);
nm_proc_int_search(‘clear’,’’,’’,‘myField2’, ‘’, ‘myfield2’, ‘’);
nm_proc_int_search(‘clear’,’’,’’,‘myField3’, ‘’, ‘myfield3’, ‘’);

Keep in mind that you need to add a call to function nm_proc_int_search for each refined search field in your application. Also, SC obeys the case of the field names. In this example, camel case is used (myField1) and the first parameter preserves that. The second parameter seems to use lower case. I have tested this with 6 fields in my application and it seems to work without issue.

Brad

Hello Brad, thanks so much for your hint.
I will try to implement your suggestion.
Excuse me but I’m not a programmer…
On the JavaScript button I insert your code with my reference … OK
The second part is not clear to me…Keep in mind …
What does it mean ?

You need one call to nm_proc_int_search with your parameters for each refined search field. In my example, I had 3 fields. In your application, you may have a different number of fields. Also, the first parameter is case sensitive. The second, all lower case.

I’m not sure if it would fit your requirement, but to clear the refined search, you can also just sc_redir to the same page. It will not be good if you are using advanced search / quicksearch as this will clear everything.