Answer the question
In order to leave comments, you need to log in
How to display some content in a modal window?
Tell. Here are my articles. Next to them are the "Delete" and "Edit" buttons. It is necessary that when you click on "Edit" the article is displayed in a modal. How to implement it?
Answer the question
In order to leave comments, you need to log in
If without any checks, in short there will be something like this:
On the jquery side:
function edit(id){
$.get("/edit.php",
{id:id},
function(c){
$("body").prepend(c);
$("#dialog").dialog({
autoOpen:true,
show:"fade",
hide:"fade",
modal: true,
buttons: {
"Изменить": function() {
Save();
},
"Отмена": function() {
$( this ).dialog( "close" );
}
}
});
});
return false
};
$res = mysql_query('SELECT * FROM `statja` WHERE `id` = $_GET[id]');
$row = mysql_fetch_assoc($res);
echo "<div id='dialog' title='Редактирование статьи'>
Тут то, что нужно из $row
</div>";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question