I am using ajax to send parameters and consult them, everything is functional only when obtaining the array with the records does not allow me to display the values independently
this is index.php
<script>
$(document).ready(function(){
$("#Montox").change(function(){
var varmonto = $("#Montox").val();
$.ajax({
method: "post",
url: "ajax/calc.php",
data: {monto:varmonto}
})
.done(function(data){
$('#chattext').html(data['username1']);
$('#chattext2').html(data['username2']);/*I NEED TO SHOW THE DATA 'username2'*/
});
});
});
</script>
this is my calc.php
<?php
echo json_encode(array('username1' => "luis", 'username2' => "jose"));
?>