I have the following situation:
Form
<?php
$atributos = array('id'=>'cadloja','class'=>'form-inline','role'=>'form','data-toggle'=>'validator');
echo form_open('',$atributos);
?>
<select class="form-control" id="grupo">
<option value="<?= 'retorno_ajax' ?>"><?= 'retorno_ajax' ?></option>
</select>
<?php
echo form_close();
?>
Javascript
$('#grupo').change(function () {
$('#div_retorno').load('lista_grupos');
}
Notice that I'm not using ajax requests or submitting the form in the onchange
event. With csrf
active, onchange
no longer works.
I even found some answers in SOen
, but in all, I would be forced to make another ajax request in the onchange
event. I also read in the documentation of CI
that it is possible to delete a page from csrf
:
$config['csrf_exclude_uris'] = array('controllerx/metodox');
This option is the one that gives less work, but would you still be safe?
So, that's it ... is there any way you can do other than the two I said? Thank you.