This topic is locked
[SOLVED]

  Hide the Search "Equals" drop down in PhpRunner

10/24/2010 7:36:14 AM
PHPRunner General questions
I
itnaanti author

I have found this exact thread for ASP Runner Pro and various older versions of PHP Runner, but I haven't found anything that applies directly to PHP Runner 5.2
How do I set the search type drop-down to always be a single type (i.e. "Equals" or "Between") and then hide the actual drop-down box?
Any suggestions or links to threads describing this would be much appreciated!

A
ann 10/26/2010

Chad,
you can delete other options in the generated classes/searchcontrol.php file.

Here is a sample for text field:

elseif ($fType == EDIT_FORMAT_TEXT_FIELD || $fType == EDIT_FORMAT_TEXT_AREA || $fType == EDIT_FORMAT_PASSWORD

|| $fType == EDIT_FORMAT_HIDDEN || $fType == EDIT_FORMAT_READONLY)

{

$options.="<OPTION VALUE=\"Contains\" ".(($selOpt=="Contains" && !$not)?"selected":"").">"."Contains"."</option>";

...

}

else



replace it with:

elseif ($fType == EDIT_FORMAT_TEXT_FIELD || $fType == EDIT_FORMAT_TEXT_AREA || $fType == EDIT_FORMAT_PASSWORD

|| $fType == EDIT_FORMAT_HIDDEN || $fType == EDIT_FORMAT_READONLY)

{

$options.="<OPTION VALUE=\"Equals\" ".(($selOpt=="Equals" && !$not)?"selected":"").">"."Equals"."</option>";

}

else



To hide the dropdown proceed to the Visual Editor tab of the Search page, switch to HTML mode and add id for the field:

<TD><div id=hidediv>{$searchtype_Field1}</div></TD>



Use JavaScript to hide it.

I
itnaanti author 10/27/2010

Perfect, thank you!
For others finding this post, the javascript that I used is:

document.getElementById('divId').style.display = 'none';


Also for others reading this post, note that editing the searchcontrol.php file is not necessary if you just want to hide the drop-down. Just setting the div id and using that Javascript worked for me.
Chad