This topic is locked

Advanced search need

12/2/2008 5:54:53 AM
PHPRunner General questions
M
mmponline author

I have a currency field on the advanced search page. I need to show the between option only. I know how to "hide" the options of Equal / More than / Between /etc. I now only want the between option to be availble on this specific field allowing the option of 2 boxes with the between search.
Please assist...

J
Jane 12/2/2008

Hi,
use Search page: Before display event for this purpose.

Here is a sample:

// write search options

$options="";

$options.="<OPTION VALUE=\"Between\" selected>BETWEEN</option>";

$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_FieldName\" SIZE=1 onChange=\"return ShowHideControls();\">";

$searchtype .= $options;

$searchtype .= "</SELECT>";

$xt->assign("searchtype_FieldName",$searchtype);

M
mmponline author 12/9/2008

I've tried theis code, just making the changes to my fieldname:

// write search options

$options="";

$options.="<OPTION VALUE=\"Between\" selected>BETWEEN</option>";

$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_SellingPrice\" SIZE=1 onChange=\"return ShowHideControls();\">";

$searchtype .= $options;

$searchtype .= "</SELECT>";

$xt->assign("searchtype_SellingPrice",$searchtype);


I get the following error, however:

Fatal error: Call to a member function on a non-object in /usr/www/users/sonjab/sonjabdb/include/Properties_events.php on line 198
BTW - This project is still in Version 4.2 as I have done a lot of customisation and is scared of losing hours of work.

J
Jane 12/11/2008

Hi,
here is a sample code for PHPRunner 4.2:

// write search options

$options="";

$options.="<OPTION VALUE=\"Between\" selected>Between</option>";

$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_FieldName\" SIZE=1 onChange=\"return ShowHideControls();\">";

$searchtype .= $options;

$searchtype .= "</SELECT>";

$smarty->assign("searchtype_UnitPrice",$searchtype);