I have an string value from my database which is the id and I have a button with a javascript function onclick="values('argument')".
My problem is that when i tried to click on that button i have this error:
(index):1 Uncaught ReferenceError: argument is not defined
I know this happens because the argument is not treat as a string.
How can I pass the argument as a string?
All this is a table which is contained in a php function that shows info from my database
This is my complete code.
<?php
function oportunities($resultQuery)
{
echo '<div class="table-responsive">
<table class="responstable">
<thead class="thead">
<tr>
<th>No.</th>
<th>value1</th>
<th>value2</th>
<th>value3</th>
<th>value4</th>
<th>value5</th>
<th>value6</th>
<th>value7</th>
<th>value8</th>
<th>value9</th>
<th>value10</th>
<th>value11</th>
<th>value12</th>
<th>value13</th>
<th>value14</th>
<th>value15</th>
</tr>
</thead>
<tbody>';
foreach($resultQuery as $row){
echo '<tr>
<td> '. $row['id'] .'</td>
<td>'. $row['value1'] .'</td>
<td>'. $row['value2'] .'</td>
<td class="descripcion">
<p class="text-descripcion">'.$row['value3'].' </p>
</td>
<td> '.$row['value4'].' </td>
<td> '. $row['value5'].' </td>
<td><p class="text-center">'. $row['value6'] .'% </p></td>
<td> '.$row['value7'].' </td>
<td> '.$row['value8'].' </td>
<td> '.$row['value9'].' </td>
<td> '.$row['value10'].'</td>
<td> '.$row['value11'].' </td>
<td> '.$row['value12'].' </td>
<td> '. $row['value13'].' </td>
<td>
<button class="center-block btn btn-acept"><i class="fa fa-check" aria-hidden="true"></i>
</button>
</td>
<td>
<button onclick="values('. $row['id']. ')" class="center-block btn btn-editar launch-modal" data-modal-id="modal-edit"><i
class="fa fa-pencil" aria-hidden="true"></i>
</button>
</td>
</tr>';
}
echo '</tbody>
</table>
</div>';
}