I'm having problems with a popup modal box.
For some reason, the dialog box isn't displaying the text passed inside the <a>
tag where data-soldusers=\"$soldUsersstr\"
. I am using base64_encode
to encode the string which contains <select><option>
html tag. And then passes it to a popup dialog using the bootstrap framework.
php file:
$soldUsersstr=base64_encode($soldUsersstr);
echo "<p><div class=\"user-ads-action\"><a class=\"btn btn-info btn-xs\" data-toggle=\"modal\" href=\"#markSoldAds\" data-soldusers=\"$soldUsersstr\" $str> <i class=\"fa fa-mail-forward\"></i>".$this->lang->line('MarkSold')." </a></div></p>";
modal php:
<div id="divSoldUser" name="divSoldUser" class="center">
</div>
<script>
$(document).ready(function() {
$('#markSoldAds').on('show.bs.modal', function(event) {
$("#postID").val($(event.relatedTarget).data('id'));
$("#divSoldUser").html(jsbase64_decode($(event.relatedTarget).data('soldusers')));
});
});
</script>