I am trying to ajax submit PHP form, it's working fine. Now whatever the result coming from PHP is getting stored in div. I want that result to print.
Here is code,
<label>Customer. :</label>
<select type="text" class="form-control required" id="customer" name="customer" onChange="get_part(this)">
<option value="">Select Customer </option>
<?php
foreach($customer_data as $ss){
?>
<option value="<?php echo $ss['customer_id'] ;?>"
<?php if($edit_data!=NULL && $edit_data['customer']== $ss['customer_id']){echo "selected=selected";}?>><?php echo $ss['name'] ;?>
</option>
<?php
}
?>
</select>
</div>
<div class="col-lg-10 col-xs-4 form-group">
<label>Part no. :</label>
<select type="text" class="form-control required" id="part" name="part" onChange="get_lotno(this)">
<option value="">Select Part no</option>
<?php
foreach($parts_data as $pp){
?>
<option value="<?php echo $pp['part_id'] ;?>"
<?php if($edit_data!=NULL && $edit_data['part']== $pp['part_id']){echo "selected=selected";}?>><?php echo $pp['part_no'] ;?>
</option>
<?php
}
?>
</select>
</div>
<div class="col-lg-10 col-xs-4 form-group">
<label>Lot No. :</label>
<select type="text" class="form-control required" id="order_id" name="order_id" onChange="get_lotdetails(this)">
<option value="">Select Lot No</option>
</select>
</div>
<div class="col-lg-5 col-xs-4 form-group">
<label>Lot Quantity :</label>
<input type="text" name="lotqnty" id="lotqnty" class="form-control" readonly>
</div>
<div class="col-lg-5 col-xs-4 form-group">
<label>Lot Rem. Qty :</label>
<input type="text" name="lotremqnty" id="lotremqnty" class="form-control" readonly>
</div>
</div>
</div><!-- /.box-body -->
<div class="box-footer">
<button type="submit" id="submit" class="btn btn-primary">Start Test</button>
</div>
</div><!-- /.box -->
</form>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header"></div><!-- /.box-header -->
<div class="box-body" id="table_div">
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col -->
</div><!-- /.row -->
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<?php $this->load->view('admin/pages/footer.php') ?>
</div><!-- ./wrapper -->
<script type="text/javascript">
$(function () {
$("#form").validate({
rules: {
customer: {required: true},
part: {required: true}
},
submitHandler: function(form) {
$.ajax({
type: "POST",
url:'<?php echo base_url()?>admin/test/createSave',
data:'&customer_id='+$("#customer").val()+'&order_id='+$("#order_id").val()+'&part_id='+$("#part").val(),
cache: false,
async:false,
beforeSend : function ()
{
$("#submit").addClass("disabled");
$("#table_div").html('<div align="center"><img src="<?=base_url()?>admindata/dist/img/table_loader.GIF"></div>');
},
success: function (data) {
$("#ajax_loader").hide();
$("#table_div").html(data);
$("#lotremqnty").val($("#rem_lot_qty").val());
$("#submit").removeClass("disabled");
});
});
On success tabular format content comes for label printing.
Anybody can help me with label printing through PHP.
Label Printer:Toshiba B-EV4T
thanks in advance