Problems with parents and post function
Hello;
I have a problem with this code, i don't know how change carpeta value with returned data only in the changed select.
$(document).ready(function() {
$(".categorias").change(function(){
kid=$(this).parents('.parrafo').find('.categorias').val();
$.post("modules/vercategoria.php",{
action: "mostrarcarpeta",
id: kid}
,function(data){
HERE: $(this).parents('.parrafo').find('.categorias').val(data);
});})
<div id="parrafo>
<select class='categorias' name='categorias' width='90%' style='width: 90%' >
Here the options of the select
</select>
<input class='carpeta' type='text' name='carpeta' value='' '/>
</div>
<div id="parrafo>
<select class='categorias' name='categorias' width='90%' style='width: 90%' >
Here the options of the select
</select>
<input class='carpeta' type='text' name='carpeta' value='' '/>
</div>