0
Guys, this is my code on PHP
$sql = mysql_query("SELECT * FROM noty");
while($linha = mysql_fetch_array($sql)){
$notificacao = $linha["notificacao"];
echo"<div class='adm_edit'>".$notificacao."
<input type='text' class='input_edit' value='".$notificacao."'/>
</div>";
}
As you can see I’m taking the bank information and showing. So far so good, but the problem comes in the JQuery
.
$(document).ready(function(){
$(".adm_edit").on("click", function() {
$(this).children(".input_edit").show();
$("#exit_edit").show();
});
$("#exit_edit").click(function() {
$(".adm_edit").text($(".input_edit").val());
$(".input_edit").hide();
$("#exit_edit").hide();
});
});
Each content that is generated by the bank as you can see has a Input
invisible that is shown when the user clicks on the content. The problem comes after that which is when I would like when the Input
when the contents typed there were closed Div
that was clicked.
where’s this "#exit_edit" in the php file? it’s really hidden?
– DiChrist
"as you can see has an invisible Input", sorry. But I did not understand that phrase, I entered a paradox.
– Diego Souza
I was going to try to help, but I also found it confusing. Maybe someone can understand and help, but suddenly it’s better to try to clarify. As I do not have a visual notion of the elements it was a little difficult for me to understand what you call closing input and also that div would be the one that would have a content to be put in the input.
– Joao Paulo
@Diegodesouzasilva I ended up not putting the code of "Exit.php" but it is a div with "display:None" that serves to hide the input when clicked. If you want to see the code here is "<div id="exit_edit" ></div>"
– Igor Todesco
@Zoom sorry is my first time posting here and I should have detailed more, but on your question the input is with "display:None" and is visible when it is clicked the div ". adm_edit"
– Igor Todesco
@joaoPaulo sorry my first posting, but thanks for trying to help hehe :). Next time I will try to clarify better.
– Igor Todesco