Posted by Kim
2016-01-03

Hi
Is there some way to set one or more search criteria before accessing the main page in order for the search results to be updated when the page opens. For example, presetting a default entry into one of the search fields or better yet, applying an entry from a different page to have the search updated prior to reaching the main search page. Possibly using the login page userID or a field from an external page as a search parameter so when a user logged in the search results would show a list of entries that matched the search criteria. Maybe passing the data through the URL?
Posted by Tom
2016-01-04

Hi,

>presetting a default entry into one of the search fields

It's possible. As an example, I'll set the default value of the "First Name" search field to "john."
Open web/codelib/df.fl.address.inc.php and find the following array.
'first_name'=>array(
XA_CLASS=>'CVText',
XA_CAPTION=>array( LC_ENG=>'First Name' ),
XA_SIZE=>24,
XA_REQUIRED=>false,
XA_MIN_CHAR=>0,
XA_MAX_CHAR=>36,
XA_SEARCH_OP=>'s%',
XA_LIST=>'(sp)(sr)(fd)'
),
Insert this line to the array.
XA_INIT_VALUE=>array( 'search'=>'john' ),
The result should look like
'first_name'=>array(
XA_CLASS=>'CVText',
XA_INIT_VALUE=>array( 'search'=>'john' ),
XA_CAPTION=>array( LC_ENG=>'First Name' ),
XA_SIZE=>24,
XA_REQUIRED=>false,
XA_MIN_CHAR=>0,
XA_MAX_CHAR=>36,
XA_SEARCH_OP=>'s%',
XA_LIST=>'(sp)(sr)(fd)'
),