1

Hi I have problem with Bootstrap Popopver. I want to display Popover after sending data to .php file with Ajax POST method and execute .php script.

This is for sending SMS and email notifcation to our customers.

First, I have buttons located in PHP while function that parsing data from MySQL. Each row has three buttons to send to that customer. (trying first button only so far)

<div class='btn-group-vertical btn-group-sm tlacitka' role='group' aria-label='...'>
<button type='button' class='btn btn-default' onclick='predej_data(\"" . $soupiska_row['Firma'] . "\")'>SMS</button>
<button type='button' class='btn btn-default'>E-mail</button>
<button type='button' class='btn btn-default'>Pokyny k platbě</button>
</div>

On top of same php file is script section

<script >
function predej_data($Firma) {

var Firma = $Firma;
$.ajax({
    url: "sms_test.php",
    method: "POST",
    data:{'dluznik':Firma},
    success: function() { $().popover({title: "", content: "Sent.", placement:'right',}).popover('show');
    }
});
}
</script>

Parsing data to sms_test.php file is working, so far I have only this code for debugging in file sms_test.php

<?php
var_dump($_POST);
?>

But after POST data is send and php script is executed, no Popover is displayed.

Thanks for any advice.

1 Answers1

0

The problem is in missing location where the popover to appear.

success: function(data) { $('.btn').popover({title: "", content: data, ...