I have this form in my view
<form name="login" action="<?php echo base_url(); ?>households/filter" id="contactForm" method="POST">
<span class="search-options search-field">
<select id="city" name="city" class="filter-field">
<option selected="" value="-1">
<?php echo $this->lang->line("Filter By City");?>
</option>
<option value="Barcelona">Barcelona</option><option value="Madrid">Madrid</option><option value="Valencia">Valencia</option>
</select>
</span>
</form>
and here is the JavaScript for submiting the form
$(document).ready(function() {
var urlmenu = document.getElementById( 'city' );
urlmenu.onchange = function() {
var myform = document.getElementById('contactForm');
myform.submit();
};
});
but it not sending anything to the POST My controller is like
function filter() {
var_dump($this->input->post());
exit;
}
Can you help me, why am I getting
boolean false
$_POST, or$this->input->post('field name');$this->input->post(): The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.