我有一个模式,弹出一个表单,允许管理员编辑/更新新闻故事。它工作得很好,更新了数据库和所有的东西,只有'Story‘片段在模式窗口中出现在文本区域框之外。
几张图片将说明我的观点和困惑。

“'Look”是当前的故事,被拉到文本区下面的区域

添加新故事

新故事现在在数据库中,但在模式中的文本区域框下面

然而,在实际的表单页面上,它是它应该在的位置
我一遍又一遍地检查我的代码,但我唯一的想法是jquery-UI以某种方式干扰了文本区域,因为根据定义,模式中的代码等同于Edit News表单的代码。
下面是故事元素的表单代码
Story<br/>
<textarea name="edit_story"/><?php print $row['story'];?></textarea>以及弹出它的jquery
$('.edit').click(function(event){
//don't follow the link
event.preventDefault();
var $link = $(this).parent();
//load in the html from the form at edit_news
var formDOM = $("<div />").load($link.attr('href')+' #edit_form', function() {
//clear the dialog box
$('#dialog-edit').empty();
// Append to the page
$('#dialog-edit').append(formDOM);
//make the dialog
$('#dialog-edit').dialog({
autoOpen:false,
title:$link.attr('title'),
width:530,
height:465
})
//open it up
$('#dialog-edit').dialog('open');
$('#edit_form').submit(function(event){
//knock out its form processing
event.preventDefault();
$.ajax({
type : "post",
url : $link.attr('href'),
data : $(this).serialize(),
success : function() {
//close dialog
$('#dialog-edit').dialog('close');
}
})
})
})
});这里发生什么事情?
如果任何人有任何想法,请向我提出。这很可能是一个n00bish编程错误,我将优雅地接受这一点。
发布于 2011-06-09 01:06:21
在将文本打印到<textarea>标记之前,您正在关闭该标记。修复:
<textarea name="edit_story"><?php print $row['story'];?></textarea>https://stackoverflow.com/questions/6282485
复制相似问题