I am passing some parameters using javascript via GET to my controller. One of them is a field of type listboxt(select)
, however I can not get the value of the selected text to show it in my result, but rather the text that shows me is [object Object]
How can I pass the text value correctly? Thank you in advance.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$('#btn_buscar').on('click', function(){
var fecha_ini = $("#fecha_ini").val();
var fecha_ter = $("#fecha_ter").val();
var rut_usu = $("#rut_usu").val() ;
var jc = $("#rut_usu").val($( "#rut_usu option:selected" ).text());
window.open('<?php echo base_url();?>C_Porcentaje/tabla_porcentaje?fecha_ini=' + fecha_ini + '&fecha_ter=' + fecha_ter + '&rut_usu=' + rut_usu + '&jc=' + jc);
});
});
</script>