我不知道哪出了问题。反正就是利用AJAX提交我的<?php echo $i ?> 或者<?php echo $val['post_name'] ?> 指定方法里一直接收不了。 。是不是我方式错了。还是我格式错了。还是我哪还漏了做。求高手指教。
这前台。
<form id="batchs_form" action="promote/dome/" name="form1" method="post">
<input id="pid" type="hidden" value="" name="pid" to="filter">
<input id="theme" type="hidden" value="" name="theme" to="filter">
<div class="certi-rel">
<div class="pri-desc">
岗位证书包含多项核心技能,你除了可以逐项自学每个单项技能的在线课程,也可以选择进入线下教育机构进行系统性的学习。<br />
</div>
<div class="by-zhengshu">
<label>证书:</label>
<div class="list">
<?php foreach($this->postall as $key=>$val) {?>
<?php $i++ ?>
<input id="<?php echo $i ?>" type="hidden" value="<?php echo $val['post_name'] ?>" name="<?php echo $val['post_name'] ?>" >
<a id='<?php echo $i ?>' onclick="ajax_post($('#batchs_form'));" href="javascript:;"><?php echo $val['post_name'] ?></a>
<?php }?>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
<?php foreach($this->promote as $key=>$val){?>
<div class="tr-block">
<dl class="company-info">
<dt>
<img
src="<?php echo get_setting('base_url') ?>/uploads<?php echo $val['offline_icon']?>">
</dt>
<dd class="tit">
<?php echo $val['offline_name'] ?>
</dd>
<dd class="desc">
<?php echo $val['offline_desc'] ?>
</dd>
<dd class="sb">
<span class="type">
<?php if($this->url_name==$val['offline_course1']){?>
<?php echo $val['offline_course1'] ?>培训
<?php }else{ ?>
<?php echo $val['offline_course2'] ?>培训
<?php } ?>
</span><span class="choice-num">
<?php echo $val['linesum'] ?>人选择
</span>
</dd>
</dl>
</div>
<?php }?>
</div>
</form>
后台public function dome_action(){
define('IN_AJAX', TRUE);
//$name = $_POST['name'];
if (!$_POST['id'])
{
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t("加载失败".$name)));
}
foreach ($_POST['id'] AS $key => $offline_id)
{
$this->model('onadvice')->remove_advice($offline_id);
}
H::ajax_json_output(AWS_APP::RSM(null, 1, null));
}
阅读全文
收起全文