欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

复选框操作

程序员文章站 2024-01-08 14:01:46
...
复选框
复选框:
<a href="javascript:goMatomeCommit(document.getElementsByName('list_check[]'),document.getElementsByName('qst_from_check[]'),document.frm.matome_select);">
循环:
<input name="list_check[]" type="checkbox" value="{$item->est_id},{$item->client_id}" />
js:
function goMatomeCommit(obj, qst_from_check, selectbox) {
var frm = document.frm;
var action = false;
action = boxCheck(obj, '回应');
/ /查询类型
if (action) {
action = qstfromCheck(obj, qst_from_check);
}
// 
if (action) {
if (selectbox.value == "操作1") {
frm.action = "/php/est/question/saled/input.php?mode=matome";
frm.target = "_self";
frm.submit();
}else if (selectbox.value == "操作二") {
frm.action = "/php/est/question/ignore/input.php?mode=matome";
frm.target = "_self";
frm.submit();
}else {
alert("请选择数据");
}
}
} 

php:
if (is_array($est_info_matome)) {
    $count = count($est_info_matome);
}else{
    $count = 0;
}
for ($num = 0; $num < $count; $num++) {
    init(&$est_info_matome[$num],$est_info_matome[$num]->est_id,$client_id,$login->client_id,$answer_flg);
    $est_info_matome[$num]->purchase_plan_name = wordAction($est_info_matome[$num]->plan_name);
}
返回处理
$est_id_tmp = explode(",",$est_id);
    for ($nA = 0; $nA < count($est_id_tmp); $nA ++) {
        $est_id_matome .= "'" . $est_id_tmp[$nA] . "'" . ($nA != (count($est_id_tmp) - 1) ? "," : "");
    }
相关标签: 复选框操作