I want to apply if else condition on two label
<script type="text/javascript">
$(document).ready(function () {
$("#select2-1").change(function () {
//console.log($("#select2-1").val());
var orderId = $("#select2-1").val();
if (orderId != "") {
GetOrderno(orderId);
GetProduceqty(orderId);
GetPackedqty(orderId);
GetOrdernoID(orderId);
}
else {
$("#quantity-label-2").text("QTY");
$("#orderqty").empty();
}
});
});
function GetOrderno(orderId) {
$.ajax({
async: true,
type: 'GET',
dataType: 'JSON',
url: '/OrderPack/GetOrderno',
data: { orderId: orderId },
success: function (data) {
console.log(data);
//populate the didden field
$("#orderqty").val(data.orderqty);
//populate the label
$("#quantity-label-2").text(data.orderqty);
},
error: function () {
alert("There is some problem to get.");
}
});
}
I am using function to load data into label, so i want idea to how to apply if else condition
function GetOrderno(orderId)