Greetings,
In this table I make a selection and in one of the "TD" I have made an INPUT to fill that space with the desired data, all with AJAX and working perfectly, but that I do an INSERT of the INPUT I keep coming out the INPUT box and I would like to change it to the new value I entered. I think a solution would be to be able to select the parent of the clicked item and change its HTML but I do not know how to do it.
I leave the code here.
<?php
while ($result = $resultado->fetch_assoc()) {
?>
<tr>
<td><?php echo $result['id_order'] ?></td>
<td><?php echo $result['num_factura'] ?></td>
<td><?php echo $result['num_albaran'] ?></td>
<td><?php echo $result['reference'] ?></td>
<td><?php echo $result['customer'] ?></td>
<td><?php echo $result['email'] ?></td>
<td><?php echo $result['dni'] ?></td>
<td><?php echo $result['group_name'] ?></td>
<td><?php echo $result['BI'] ?></td>
<td><?php echo $result['total_paid_real'] ?></td>
<td><?php echo $result['RE'] ?></td>
<td><?php echo $result['payment'] ?></td>
<td><?php echo $result['date_add'] ?></td>
<td>
<?php
if ($result['utm_source'] != NULL || $result['utm_source'] != "") {
echo $result['utm_source'];
} else {
?>
<div style="width: 100px;">
<!--<form name="utm" action="" onSubmit="enviarDatosUTM(); return false" >
<input type="number" name="id_order" id="id_order" value="<?php echo $result['id_order'] ?>" style="display: none;" />
<input type="text" size="5px" name="utm_source" id="utm_source"/>
<input type="submit" value="✔"/>
</form>-->
<input type="number" name="id_order" id="id_order" value="<?php echo $result['id_order'] ?>" style="display: none;"/>
<input type="text" size="5px" name="utm_source" id="utm_source" />
<input type="button" href="javascript:;" onclick="enviarDatosUTM($('#id_order').val(), $('#utm_source').val());
return false;" value="✔"/>
<?php
}
?>