EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: tlombard on December 07, 2013, 12:19:18 PM



Title: Pass Greater Then / Less Then ?
Post by: tlombard on December 07, 2013, 12:19:18 PM
Can someone take a double look, and see why I cannot pass my year FILTEr values over to my PHP page...I think its becuase I;m trying to pass "<, >, =, <="...and that is breaking somehting???

I have two search fields:  Year and Year_Filter

Code:
<input id="year_FIELD" class="easyui-combobox"
        name="year_FIELD" data-options=" data: [
{yearID:'',year:'ALL'},
{yearID:'2013',year:'2013'},
{yearID:'2012',year:'2012'},
{yearID:'2011',year:'2011'},
{yearID:'2010',year:'2010'},
{yearID:'2009',year:'2009'}
],
valueField:'yearID',
textField:'year',
panelHeight:'auto'
        ">

<input id="year_FILTER" class="easyui-combobox"
        name="year_FILTER" data-options=" data: [
{value:'', label:'No Filter'},
{value:'=', label:'Equal'},
{value:'<>', label:'Not Equal'},
{value: '>', label:'Greater Then'},
{value:'<', label:'Less Then'},
{value:'>=', label:'Greater Then OR Equal'}
],
valueField:'value',
textField:'label',
panelHeight:'auto'
        ">


When the search button is clicked...those values are sent the PHP page:

Code:
<script type="text/javascript">
function doSearch(){
$('#tt').datagrid('load',{
                                yearPOST: $('#year_FIELD').combobox('getValue'),
                                yearFilterPOST: $('#year_FILTER').combobox('getValue')
});
}
</script>

My PHP code captures IS NOT CAPTURING THE YEAR_FILTER Value:

Code:
$year_year = isset($_POST['yearPOST']) ? mysql_real_escape_string($_POST['yearPOST']) : '2012';
$year_FILTER = isset($_POST['yearFilter_POST']) ? $_POST['yearFilter_POST'] : '=';

Here is my WHERE statement:

Code:
$where = "year_year $year_FILTER $year_year";


Title: Re: Pass Greater Then / Less Then ?
Post by: tlombard on December 07, 2013, 12:35:03 PM
as soon as I posted i found the error

my POST variables did not match  ::)

Code:
yearFilter_POST