The PHP line of code below should be displayed on the website and called using JavaScript.
echo "
<div class='tipoPagamento' onclick='SelecionarTipoPagamento({$row['CODIGO']}, '{$row['TIPO']}');'>
<font color='#fff'>
<h4 style='margin-top: -15px;'>{$row['ESPECI']}</h4>
</font>
</div>
";
In the second line, in the div tag .. I have to call the function 'SelectPayment Type (int, str)'. As I indicated, it has an integer parameter and another string .. so I put the variable $ row ['TYPE'] in quotation marks. But the function is not being called because it is in error.
Removing the string parameter works fine and the code looks like this:
echo "
<div class='tipoPagamento' onclick='SelecionarTipoPagamento({$row['CODIGO']});'>
<font color='#fff'>
<h4 style='margin-top: -15px;'>{$row['ESPECI']}</h4>
</font>
</div>
";
I think I'm not sure how to use the quotes correctly, but from what I saw on the internet it's correct ... what would be the mistake?
I'm using the following scripts: (I'm specifying because I've heard that some do not accept single quotes or something)
<script src="js/jquery.min.js"></script>
<script src="js/database.js"></script>
<script src="js/jquery.poptrox.min.js"></script>
<script src="js/jquery.scrolly.min.js"></script>
<script src="js/jquery.scrollex.min.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/init.js"></script>
<script src="js/jquery.mask.js"></script>
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-wide.css" />
<link rel="stylesheet" href="css/style-normal.css" />
</noscript>
<script src="js/jquery-1.11.2.min.js"></script>
<script src="js/jquery.maskedinput.min.js"></script>
The 'SelectPayment ()' function is this:
function SelecionarTipoPagamento(cod, tipo){
alert("oi");
alert(cod);
alert(tipo);
codTipoPagamento = cod;}