On my form submissing I have several checkboxes styled with images that the user checks before submitting form.
I would like (ideally) to create a filter where the user selects the same image checkboxes.
Is that doable?
You need to provide details for what you want to achieve. I have no idea what you're asking here. Explain the workflow and results you want to accomplish.
I looked at the title of this post. You want to "Filter view entries by checkbox selection". What you explain the post doesn't really connect to the post title.
What you need to do is create a search screen that uses the same checkbox design as the input form. Easy, peasy! And the good news is that it's documented in the Formidable Knowledgeable: https://formidableforms.com/knowledgebase/create-custom-search-form/
Awesome, I will give it a try..
I followed the instructions in the link - but my search results always come back empty. I'm not sure if I have the syntax correct in the piece of code.I replaced "205" with my entry of where all the uploaded user data is displayed (in my case 373) - You call this the "Results View" where the filters are added. I replaced the three entries 82,83,84 with a single entry (212 the field id of the search checkbox field I created)
Original code here
add_filter('frm_filter_where_val', 'frm_search_multiple_values', 8, 2);
function frm_search_multiple_values($where, $args){
if ( $args['display']->ID == 205 and in_array( $args['where_opt'], array( 82, 83, 84 ) ) ) {
$where = explode(', ', $where);
}
return $where;
}
My code here
add_filter('frm_filter_where_val', 'frm_search_multiple_values', 8, 2); function frm_search_multiple_values($where, $args){ if ( $args['display']->ID == 373 and in_array( $args['where_opt'], array( 212 ) ) ) { $where = explode(', ', $where); } return $where; }
Thanks for any help.
I suggest installing a WordPress debug plugin (e.g., Debug Log Manager Tool) and using error_log to write out the values of the variables in the snippet to see what's what. Additionally, I suggest using "&&" instead of "and". Finally, so that there's no confusion, the term "entry" in Formidable refers to the result of a form submission. So 373 is not an entry; it's a "View ID," and 212 is not an entry; it's a field ID. I realize it's semantics, but it's important to differentiate.
Hi There, well I got there eventually, took the best part of a day!
But what did you mean by
I suggest using "&&" instead of "and".
I'm a little confused by what you're trying to do. The knowledgebase article about creating a search form makes no mention of the frm_filter_where_val hook. You are also using it incorrectly. As Rob already pointed out $args['display']->ID is a view ID, not an entry ID.
Please login or Register to submit your answer