Sir I have these codes
<script>
function myCall() {
var data = $("#datepicker-13").val();
alert(data)
var request = $.ajax({
url: "ajax_arrival.php",
type: "Get",
data: {
"date": data
},
dataType: "html"
});
request.done(function(msg) {
msg = data.split("##");
$("#wh_bg1").val(msg[0]);
$("#wh_jt1").val(msg[1]);
$("#wh_wt1").val(msg[2]);
// alert(msg);
});
request.fail(function(jqXHR, textStatus) {
alert("Request failed: " + textStatus);
});
}
</script>
and ajax_arrival.php is like this
$query ="SELECT qty,jute,weight FROM arrival where date= '$date.'";
$result=mysqli_query($con, $query);
if ($result){
$row = mysqli_fetch_array($result);
$msg=$row['qty']."##".$row['jute']."##".$row['weight'];
echo $msg;
}
The query gets proper data in $msg but this response section does not work
request.done(function(msg) {
msg = data.split("##");
$("#wh_bg1").val(msg[0]);
$("#wh_jt1").val(msg[1]);
$("#wh_wt1").val(msg[2]);
});
Please help me how to display responsed data into these textboxes
<input type="text" id="wh_jt1" name="wh_jt1" value="<?php if($wh_jt>'0'){ echo $wh_bg;}else{echo "";}?>"/> <input type="text" id="wh_bg1" name="wh_bg1" value="<?php if($wh_bg>'0'){ echo $wh_bg;}else{echo "";}?>" /> <input type="text" id="wh_wt1" name="wh_wt1" value="<?php if($wh_wt>'0'){ echo $wh_wt;}else{echo "";}?>"/>
Thanks