Skip Navigation

[Resolved] Split: Searching repeatable fields – Reset button not working

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by mikeH-3 5 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1376999

3rd Question. When I enter a first name and then click reset, the 'first name' field doesn't clear. The others do. Is that something to do with your code or is it a bug?

#1377001

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

3rd Question. When I enter a first name and then click reset, the 'first name' field doesn't clear. The others do. Is that something to do with your code or is it a bug?
===>
Yes - this is again due to we added the frontend filter field that belongs to repeating field groups of "Family Member" and view is set to query to "Members" post type. We need to apply a trick here:

To address this issue I've added the query filter for first name field to the view:
- hidden link

First Name is a string equal to URL_PARAM(wpv-wpcf-first-name)

And added the following code to the "Custom Code" section:
- hidden link

 foreach((array)$query['meta_query'] as $k=>$v):
                if(isset($v['key']) and $v['key']=='wpcf-first-name'){
                     unset($query['meta_query'][$k]);     
                 }
     endforeach;

Can you please confirm now, Reset button works as expected.

#1378309

My issue is resolved now. Thank you!