1
I made it a little easier, but it’s not working yet. Instead of assembling everything in javascript, in my action I assemble all html and in javascript I only pass the mounted html to my select.
function MostraPrograma(){
var _valorSelect = document.getElementById("CursoEscolaId").value;
$.post('/novas/mostra_programa/'+_valorSelect),$("#CursoNewAddForm").serialize(), function(data){
$("#rowIdChata").html(data);
}
}
and this is my view:
<?php
if($info_campus == 0){
echo 'Não existem tipos de curso para esta escola';
}else{
foreach($info_campus as $info){?>
<option value="<?=$info['CursoCampus']['id']?>"><?=$info['CursoCampus']['nome']?></option><? php }} ?>
edited, made it a little easier, but still doesn’t work, it seems to me that when he gives post not back to function, and nothing that is inside my post runs.
– Michel Henriq
applies step 1, and uses the.log console to identify whether it is occurring as predicted. Then apply step 2 and use the.log console to see if you are also proceeding as desired
– Vinicius Dutra
I made a small modification in step 2 too, in the excerpt -> Fragment.cloneNode(true)
– Vinicius Dutra
the problem was that I was running the function
$post
wrong, I was doing$post(url),function
and the right thing is$post(url,function{});
– Michel Henriq
Wow, you didn’t even realize this mistake. But it’s a good thing you found it yourself. You can be sure you learned a lot. Good luck there
– Vinicius Dutra
Thank you very much, we took our time, but we made it.
– Michel Henriq
That’s it, good luck!
– Vinicius Dutra