3
I am developing a basic CRUD, and I need that when the user click EDIT, open a form below, or side, no matter, with the fields for him to edit such information, and when click 'OK', the field disappear and show the edited fields.
<?php
$sql = "SELECT * FROM postagens";
$result = $postagens->select();
while ($array = mysql_fetch_array($result)){
echo '<h2><li>' .$array['titulo'].'<h2></li>
<h4><li>' .$array ['conteudo'].'</li></h4>
<h4><li>'.$array['id'].'</li></h4>
<a href="Postagens/editarPost.php"><input type="button" value="Editar"></a>
<a href="index.php?exid='.$array['id'].'"><input type="button" value="Excluir"></p>';
?>
Put the code to make it easier to help you
– LocalHost
is using jquery?
– alexandre9865
I’m not wearing it, but I think I do, I don’t quite understand. The idea would be to make a hidden form, so when the user click edit, it appears, with the option to update the fields and give the Submit in it.
– Jean Carlos Da Campo
I put the answer with jquery there
– alexandre9865
Okay, thank you so much for your help and willingness. Thanks !
– Jean Carlos Da Campo
worked out? if it didn’t work out, just say!
– alexandre9865
put tbm an option without using jquery, if you prefer!
– alexandre9865
Jean, define an id or at least a name for each html element of yours, so it makes it easy to control and maintain the elements of your page
– alexandre9865
I got it, I added your answer to the one from the partner down there, and I got it :D I started seeing js, jquery, and the like a week ago, so I’m not very familiar, but you guys helped me a lot, thank you very much!
– Jean Carlos Da Campo
Thank you! Since you solved your problem, choose one of the answers as correct, to indicate that your doubt has been solved.
– alexandre9865