I want to insert within a modal a textfield with a button that picks up the value of this textfield when I click on the button, for this I am using jquery and I am inserting the html next to a if(isset($_POST["boton"]))
in php to perform an action when the button is pressed.
in this way:
$(document).ready(function(){
$('#ModifCo').click(function(){
$('#inyeccion').html('<form method="post">'+
'<table>'+
'<tr>'+
'<td>Comision de la AFP  </td>'+
'<td><input type="number" name="txtComisionAFP"></td>'+
'</tr>'+
'<td><br><input type="submit" name="boton" id="boton" value="Insertar Datos" class=" btn btn-default"> <br> </td>'+
'</form>'+
'<?php'+
'if(isset($_POST["boton"]))'+
'$ComisionAFP= $_POST["txtComisionAFP"];'+
'require_once "AFP.php";'+
'require_once "UpdateDB.php";'+
'$afp= new AFP("","","",$ComisionAFP);'+
'$op= new Update();'+
'$op->UpdateComision($afp);'+
'</table>')
});
The problem arises here $op->UpdateComision($afp);
since jquery does not detect the arrow - > and he sends it to me only as a text.
Well some suggestion. PS: I'm learning