This topic is locked

Dropdown selection default value

9/25/2006 8:24:41 PM
PHPRunner General questions
K
ke5rs author

I would like to know how I can change the default "Contains" value in the dropdown selection to "Starts with ..." in the advance search page when searching for a value in a text box..
Thank you
John

J
Jane 9/26/2006

John,
open ..._search.php file, find following lines:

if($not)

$smarty->assign("not_FieldName"," checked");

// write search options



where FieldName is your actual field name.

Then edit code after it. See my changes in Bold:

$options="";

$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Starts with ..."."</option>";

$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contains"."</option>";

$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equals"."</option>";

K
ke5rs author 9/26/2006

Thanks Jane

I looked for what you suggested and no luck but I did find the following line...
$a=array("Contains","Equals","Starts with ...","More than ...","Less.....etc......
I found by just changing the order in the array would do the trick
$a=array("Starts with ...","Contains","Equals","More than ...","Less.....etc......
I don't know how I missed that before but this modification is working now.

Thanks a bunch...

John

John,

open ..._search.php file, find following lines:
where FieldName is your actual field name.

Then edit code after it. See my changes in Bold: