我想使用cakephp form helper动态附加一些表单元素。
我缺少什么?
<script type="text/javascript">
$("a#megyeAdd").click(function(){
$("div#moreCounty").append(
<?php echo $this->Form->input('ColleaguesCounty.1.county_id',array('label' => 'Megye')); ?>
);
});
</script>
答案 0 :(得分:0)
您在.append参数上缺少引号。
$("div#moreCounty").append("<?php echo $this->Form->input('ColleaguesCounty.1.county_id',array('label' => 'Megye')); ?>");