JS取不到append中追加的FCKeditor的值
如题,我在jQuery的append中追加了一个FCKeditor编缉器,却用JS取不到刚追加的值。也就是红色代码部分弹出的是空值。
看下代码吧:
<?php
include_once('include/top.php');
/* css */
require_once('../'.DIR_INCLUDE.'/comm_include_for_css.php');
/* js */
echo('<script src="'.fs_get_root_a().'/'.DIR_RESOURCES.'/js/jquery-1.5.1.min.js"></script>');
?>
<script type="text/javascript">
$(function(){
var i = document.getElementsByName("question_id[]").length + 1;
$('#add_test_content').click(function(){
if(i >= 1) {
$('#add_test').append('<div><label><div align="center"> '+i+'. 试题题目:</div></label><?php include("../fckeditor/fckeditor.php"); $oFCKeditor = new FCKeditor("test_content'+i+'"); $oFCKeditor -> BasePath = "../fckeditor/"; $oFCKeditor -> Value = ""; $oFCKeditor -> Width = "80%"; $oFCKeditor -> Height = "150"; $oFCKeditor -> Create(); ?><br /><input name="question_id[]" type="hidden" value="" />-<a href="#" id="del-test" class="lj">删除</a></div>');
i++;
}
});
$('#del-test').live('click',function(){
$(this).parent().remove();
i--;
});
});
</script>
<script>
function _(c){
return document.getElementsByName(c);
}
function Check(c){
alert(document.addform.test_content6.value+":"); for(var i = 1; i <= _(c).length; i ++){
if(document.addform["test_content"+i].value == ""){
alert('第'+i+'道题目不能为空!');
return false;
}
}
}
</script>
<form name="addform" method="post" action="?">
<fieldset>
<div align="left" id="add_test">
<table border="0" cellpadding="2" cellspacing="1" width="100%">
<?php
for($i=1;$i<=5;$i++){
?>
<tr>
<td width="20" align="center" valign="top"><?php echo($i);?>.</td>
<td width="70" valign="top"><div align="right">试题题目:</div></td>
<td><?php
include("../fckeditor/fckeditor.php");
$oFCKeditor = new FCKeditor('test_content'.$i);
$oFCKeditor -> BasePath = "../fckeditor/";<