我有一個表單(報表),它在頁面上多次鏈接到jquery對話框。我添加了隨機字符串以避免交叉發送(提交)。我想在提交後清除表單(ReportContent)字段,並有一點問題。然而,它在下面第二個腳本的單頁訪問提交中工作正常。請幫幫忙,...在此先感謝...克里斯在cakephp 1.3中提交後的清晰表格
<?php echo $ajax->form(array('type' => 'post', 'options' => array('model'=>'Group', 'id'=> "submitThis_".$random, 'update' => "updateGroupReport_".$group['Group']['id']. '-'.$random, 'complete' => 'javascript:resetReportGroupForm(' . $random . ');', 'url' => array('controller' => 'groups', 'action' => 'report/'. $group['Group']['id'])))); ?>
<?php echo $this->Form->textarea('Report.content', array('class' => "ReportContent_".$random)); ?>
<?php echo $form->end('Report'); ?>
此我要工作,...
<script type="text/javascript">
function resetReportGroupForm($id){
document.getElementById("submitThis_<?php echo ($random); ?>"), function() {
$('.ReportContent_<?php echo ($random); ?>').val('');
};
};
</script>
能正常工作的單頁訪問,...
<script type="text/javascript">
function resetReportGroupForm($id){
document.getElementById("submitThis_<?php echo ($random); ?>").reset();
}
</script>