Custom Filter

create a custom filter for a CF form listing.

Overview

The custom filter was not working because the input field name in the HTML did not match the variable name used in the PHP conditions code.
Ensure the name attribute of your HTML input field exactly matches the variable name you are retrieving in your PHP conditions script.

Answered
sz szabob 14 Oct, 2015
Hi,

I need to make a custom filter (I know the built-in filter but it does not suit me because I need a more complex one).

I started with something basic:

I put this in the header of the listing:
 Email: <input type="text" name="emai11" placeholder="email here" class="form-control A" />
<br>
<input type="submit" name="submit" value="Submit" />


The Conditions box is as follows:
<?php 
$var = JRequest::getString('email11','', 'get');
return array('Orders.email' => $var);
?>


Unfortunately it doesn't work. $var is always empty. Am I missing something ?
sz szabob 14 Oct, 2015
Answer
Yes, I was missing a letter 'l' in the first line. Thanks for the highlighter in this forum! 😀
This topic is locked and no more replies can be posted.