0
echo '<button onclick="deleteVaga('.$id,$cidade.')"><i class="far fa-trash-alt" style="font-size:36px;color:#f00;"></i></button>';
in deleteVaga function, it recognizes only one variable passed, but do not know how to pass $id and $city as two parameters, to then search with ajax.
echo '<button onclick="deleteVaga('.$id,$cidade.')"><i class="far fa-trash-alt" style="font-size:36px;color:#f00;"></i></button>';
Alters toecho '<button onclick="deleteVaga('.$id.','.$cidade.')"><i class="far fa-trash-alt" style="font-size:36px;color:#f00;"></i></button>';
The comma is part of html and not part of php being passed.– Felipe Paz
I’ve tried that too and it didn’t work, there’s another way to pass these parameters?
– Luan Rodrigues
No champion, a resolution of your question. In the event
deleteVaga
vc is passing the comma without encapsulating to be identified as an html, so just insert adeleteVaga('.$id.','.$cidade.')
. See now that the comma is part of html .– Felipe Paz
Since the city probably has space, you need it to be in quotes, like this
('.$id.',\''.$cidade.'\')
– Dobrychtop
Perfect Dobrychtop, worked exactly as I wanted, as I close or give this question as solved?
– Luan Rodrigues