You can apdatate this code for your use:
<select class="input-xxlarge empresaRegistro" name="empresaRegistro" id="empresaRegistro" style="width: 715px !important;" onChange="getFuncionario()">
<option value="">Selecione a Empresa</option>
<?
foreach($lista_cedente as $valor){
?>
<option value="<? echo $valor->idCedente; ?>"><? echo $valor->razaosocial; ?></option>
<? } ?>
</select>
Script jQuery:
<script>
function getFuncionario() {
var id = $('#empresaRegistro').val();
$(".idFuncionarioLista").append('<option value="0">Carregando...</option>');
$.post("<? echo base_url(''); ?>proventos/ajax/funcionario/"+id,
{idFuncionarioLista:jQuery(id).val()},
function(valor){
$(".idFuncionarioLista").html(valor);
}
);
}
</script>
In this scheme: When you select the Registration Company (Company field), I enter the ajax and search all the data and list them below in a next field select also called idFunctionshipList. You can do the same type of jquery to search for the next select, then using onchange="NAMESENCUNCAO()" in select idFunctionaryList for example.
Do you have any code of your attempts to show?
– al'ein