My last try
Controller:
class Your_controller extends CI_Controller {
public function ajax_checklogin() {
$login = $this->input->post('login', TRUE);
if (!$this->user_model->if_exists(array('login' => $login))) {
echo 'Free';
return FALSE;
}
echo 'Taken';
return FALSE;
}
}View:
$.post("<?php echo base_url()?>your_controller/ajax_checklogin", { login: $("#selector").val() })
.done(function(data) {
$("#otherselector").html(data);
});user_model->ajax_checklogin returns true if exists, false if not.