This topic is locked

Checkboxes

5/24/2007 3:10:13 PM
PHPRunner General questions
W
wengen author

Hello,
I searched the forum hoping that someone else had this issue, but could not find it.
I have a column of data (MySQL) as tinyint with "0"s and "1"s
I selected checkbox on the Visual Editor for Search Page, but the selections are showing up on the Advanced Search page as true/false dropdowns when I upload the php to our server (_search.php). I want the selections to show up as checkboxes on the Advanced Search Page. How do I do this?
Thanks

Sergey Kornilov admin 5/24/2007

Proceed to the Search page in Visual Editor, double-click on this field and set "Edit as" type to "Checkbox".

W
wengen author 5/24/2007

Sergey thanks,
I twice tried going to the Search page in Visual Editor, double-clicking on this field and set "Edit as" type to "Checkbox". It Still does not work.
Here is the HTML from the Visual Editor HTML view:
[codebox]<TD class=fieldname width=83>active <input type="Hidden" name="asearchfield[]" value="active"></TD>

<TD align=middle width=40><INPUT type=checkbox name=not_active

{$not_active}></TD>

<TD width=69>{$searchtype_active}

</TD>

<TD width=275>{build_edit_control field="active" value=$value_active mode="search"}</TD>

<TD width=275><SPAN id=second_active>{build_edit_control field="active" second=true value=$value1_active mode="search"} </SPAN></TD>[/codebox]
Here is the actual HTML from the page after we transfer it to our server:
[codebox]<input type="hidden" name="type_active" value="checkbox"><select name="value_active"><option value="none"></option><option value="on">True</option><option value="off">False</option></select></TD>[/codebox]
I must be missing something.
Thanks again.

J
Jane 5/25/2007

Hi,
you can add check box to the search page in the Visual Editor manually.

Click on the field, turn on HTML mode, find this code:

{build_edit_control field="active" value=$value_active mode="search"}

and replace it with this one:

<input type="hidden" name="type_active" value="checkbox"><INPUT type=checkbox name=value_active>


Please note that checkbox doesn't work correctly on the Search page. If you checked this field search is correct, but if you uncheck active field search returns all values (with active=1 and active=0) because unchecked field means that you don't want to use this field in the search.

W
wengen author 5/25/2007

Thanks!
That did exactly what we want.
wengen

W
wengen author 6/4/2007

Jane I have one last question on this.
How do we hide the "equals" dropdown generated from {$searchtype_xxxxxx}? We would like to be able to do this upfront in the Visual Editor so that we can create a clean design just showing the checkboxes.. When we remove {$searchtype_xxxxxx}, the search page is not generated correctly.
Thanks again.
wengen

J
Jane 6/5/2007

Hi,
you need to do the following:

  1. turn on HTML mode on the Visual Editor tab,
  2. find this line:
    <input type="hidden" id="a" name="a" value="advsearch">

and replace it with this one:

<input type="hidden" id="a" name="a" value="advsearch">

<input type="Hidden" name="asearchopt_FieldName" value="Equals">



where FieldName is your actual field name.
3. Then remove {$searchtype_xxxxxx} and build your project.

W
wengen author 6/5/2007

Thanks!
wengen