Disable SearchType option

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
stavfx
User
Posts: 3

Disable SearchType option

Post by stavfx »

Hi, i want to make the Search only go by "Exact phrase" and not have the option for "All words" or "Any word".
how do i go about doing that?

thanks,
Stav;


danielc
User
Posts: 1599

Post by danielc »

Use jQuery to hide the radio button


mobhar
User
Posts: 11905

Post by mobhar »

Hiding the options using jQuery won't disable the functionality of the other search options in the Basic/Quick Search. The closest approach is by customizing the template file. See the related code in the "list-script-search.php" file.


SouzaRM
User
Posts: 7
Location: Brasilia - Distrito Federal - Brazil

Post by SouzaRM »

(Sorry my bad english)

Dear StavFx,

In my initial and humble knowledge:


In [Client scripts --> Global --> StartUp Script]
$("#xsr_2").remove();


I know I There is the option: [PHPMaker --> Table --> Search --> Default search type (Quick) --> Exact match | All words | Any words],
BUT do not trust due to session cookies that are stored (would need clear your browser to take the standard value between the sessions).

THEN I change the snippet at hand: [ $this->BasicSearch->Type = "="; ]

In (...)list.php:

(...)
// Load basic search values
function LoadBasicSearchValues() {
$this->BasicSearch->Keyword = @$GET[EW_TABLE_BASIC_SEARCH];
if ($this->BasicSearch->Keyword <> "") $this->Command = "search";
// $this->BasicSearch->Type = @$
GET[EW_TABLE_BASIC_SEARCH_TYPE];
$this->BasicSearch->Type = "="; <------------------------------------------------------------------------------------------------------------------
}
(...)

Good luck...


stavfx
User
Posts: 3

Post by stavfx »

thanks a lot! :)


Post Reply