Search form (multi fields)

How to create a search form with multiple filter fields in ChronoForms.

Overview

The user needed to combine multiple fields for filtering, but CCv5 only supports one primary search field by default.
Use custom conditions in the connection by adding fields to the form header, capturing their values, and applying them as LIKE conditions for partial text matching.

Answered
ra rastatom 04 Apr, 2014
Hi everybody,
Is there anyone who create a search form?
I have created a form and a connection but i don't know how i can associate them...
I try to just use CCv5 but i have to combinate more than one fields.
Max_admin Max_admin 04 Apr, 2014
Did you check the CCv5 tutorials on the FAQs page ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ra rastatom 04 Apr, 2014
Yes, i have read the FAQs but i don't find my response. I go to read the FAQs yet.
Max_admin Max_admin 07 Apr, 2014
Ok, just to clarify this, you can only have 1 search field in CC, its name should be "srch".

You can however, have multiple "filter" fields.

Please let me know what you need to do exactly, and I can add a new tutorials on the subject!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ra rastatom 08 Apr, 2014
Absolutely, i would like to have multiple filter fields.
In my database, for example, i have :
sender - date - subject ....
In fact, i would like to be able to "search" a sender and a subject (or a date and a subject....).
Max_admin Max_admin 08 Apr, 2014
What about this new tutorial:
https://www.chronoengine.com/faqs/72-ccv5/5217-adding-search-or-filter-fields-to-your-listing.html
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ra rastatom 09 Apr, 2014
All is OK.
Thank you for your tutorial !!!
I will try tomorrow to use dropdown list.
ra rastatom 09 Apr, 2014
Is it possible that filter field works like search filed? (search a part of a text, not the exact text)
Max_admin Max_admin 09 Apr, 2014
No, that's not how filters should work, but I may add the feature to the next release, you may contact me using the "contact us" page to get the patch when its ready!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin Max_admin 27 Apr, 2014
Answer
Hi rastatom,

An update here, I think that the best and easiest way to do this is to customize your "conditions" based on a custom field, so let's say you add a new field to the "Header" box and name it "title_search" then you can catch its value in the conditions box and do the search:

$title_search = \GCore\Libs\Request::data("title_search");
if($title_search){
return array("title LIKE" => "%".$title_search."%");
}else{
return array();
}


This way you can search for this text, you can also add the field name "title_search" to the sessioned box so that the connection can preserve the value.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ra rastatom 28 Apr, 2014
Thank you Max. It is the best solution.
This topic is locked and no more replies can be posted.