i am using this tooltip popover from here .. what i want is to display data in this tooltip after getting the data from controller .. i dont know how can i do this .. i have a textbox where i have applied a blur function so if user enter something in inputbox it displays the data against it in tooltip .. i dont know how can i used this tooltip in my script
my textbox in view page
Bill No:<?php echo form_input($bill_no); ?>
<input type="hidden" class="hiddenUrl">
in this span i want to display the tooltip just infront or above the inputbox
<span class="text"> </span>
my javascript
<script type="text/javascript">
$(document).ready(function(){
$('#bill_no').blur(function(){
if( $('#bill_no').val().length >= 3 )
{
var bill_no = $('#bill_no').val();
getResult(bill_no);
}
return false;
})
function getResult(billno){
var baseurl = $('.hiddenUrl').val();
// $('.checkUser').addClass('preloader');
$.ajax({
url : baseurl + 'returnFromCustomer_Controller/checkBillNo/' + billno,
cache : false,
dataType: 'json',
success : function(response){
$(".text").html(response.result);
}
})
}
})
</script>
mycontroller…
function checkBillNo($billno)
{
$this->load->model('returnModel');
$query = $this->returnModel->checkBillNo($billno);
$billno = $this->uri->segment(3);
$billno_results = $this->returnModel->sale($billno);
//header('Content-Type: application/x-json; charset=utf-8');
echo json_encode($billno_results);
}
You have to insert the returned text into the
data-contentattribute:or