This topic is locked

Simpler Search Option

11/14/2006 12:56:42 PM
PHPRunner General questions
M
mmponline author

The search table on top of the list page is very handy. Somehow, some users get confused with all the options. How do I simplify this to:

  1. Show only the search input box.
  2. No field dropdown box
  3. No contains, equals, etc. box.
    IOW
    When searching, the search must search specified fields, although not shown in a dropdown box.

    and only seach for contains by default.
    I tried to just to delete these in the isual editor, but obviously it wont work. Somehow, it needs to be in the HTML coding, without displaying a box in the WYSIWIG view.
    Thanks for the help.

Sergey Kornilov admin 11/14/2006

Stephan,
you can remove those controls in visual editor and also assign value to the following hidden field in HTML mode:

<input type="Hidden" name="SearchOption" value="Contains">

M
mmponline author 11/15/2006

Sergey
I removed the two inputs and changed the form line to:

<FORM name=frmSearch action=ProductInfo_list.php method=get><input type="Hidden" name="a" value="search"><input type="Hidden" name="value" value="1"><input type="Hidden" name="SearchFor" value=""><input type="Hidden" name="SearchOption" value="Contains" input type="Hidden" name="SearchField" value=""></FORM>
I previews correctly but gives an "error on page" message at the bottom of the page and no searches happen.
??

D
Dale 11/15/2006

I think the error might be in your line below. You havent closed the input
<input type="Hidden" name="SearchOption" value="Contains" input type="Hidden" name="SearchField" value="">
change to
<input type="Hidden" name="SearchOption" value="Contains"> \\ just need the closing >

<input type="Hidden" name="SearchField" value=""> \\ Add the < to the front of your input

M
mmponline author 11/16/2006

Here is the line with the changes. The <> dissapeared in my effort to bold it. The coding is as shown here, but still gives the error on page message. I'm using the MSAccess feature working on an offline DB.
<FORM name=frmSearch action=ProductInfo_list.php method=get><input type="Hidden" name="a" value="search"><input type="Hidden" name="value" value="1"><input type="Hidden" name="SearchFor" value=""><input type="Hidden" name="SearchOption" value="Contains"><input type="Hidden" name="SearchField" value=""><FONT size=2></FORM></FONT>
????

Sergey Kornilov admin 11/16/2006

Stephan,
my post says you need to add only one hidden field named SearchOption.
You trying to do something different.

M
mmponline author 2/10/2007

I've tried everything but always get a error on page (javascript message in bottom of browser.
I want to:
Remove the the options for any field and contains, only leaving the search input. If I follow what you explain in the forum, it still doesn't work.
Please help!
I would like to see this as a fearure on the search to have the optionns of asdding these controls.
Further: Is there a way to add the search input to the menu page, so that the user can type any keyword there and see the results on the list page on enter.
Thanks for your help.
Stephan

J
Jane 2/12/2007

Stephan,
you can do the following:

  1. proceed to the Visual Editor tab, remove the options for any field and contains
  2. turn on HTML mode, find following line:
    <input type="Hidden" name="SearchOption" value="">

and replace it with this one:

<input type="Hidden" name="SearchOption" value="Contains">


3. Find this code snippet:

<INPUT id=ctlSearchFor onkeydown="e=event; if(!e) e = window.event; if (e.keyCode != 13) return true; e.cancel = true; RunSearch(); return false;"

{$search_searchfor}> &nbsp; <INPUT class=button onclick="java script: RunSearch();" type=button value=Search>

and replace it with this one:

<INPUT id=ctlSearchFor onkeydown="e=event; if(!e) e = window.event; if (e.keyCode != 13) return true; e.cancel = true; frmSearch.SearchFor.value = document.getElementById('ctlSearchFor').value; frmSearch.submit(); return false;" {$search_searchfor}> &nbsp;

<INPUT class=button onclick="java script:frmSearch.SearchFor.value=document.getElementById('ctlSearchFor').value; frmSearch.submit();" type=button value=Search>


Regarding the second question.

You can do it modifying generated menu.php and menu.htm files manually.

Unfortunately we don't have a ready to go solution for this.

M
mmponline author 2/12/2007

Thanks! Works 100%