首頁 >php教程 >PHP源码 >复选框操作

复选框操作

PHP中文网
PHP中文网原創
2016-05-25 17:09:431252瀏覽

复选框

复选框:
<a href="javascript:goMatomeCommit(document.getElementsByName(&#39;list_check[]&#39;),document.getElementsByName(&#39;qst_from_check[]&#39;),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, &#39;回应&#39;);
/ /查询类型
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 .= "&#39;" . $est_id_tmp[$nA] . "&#39;" . ($nA != (count($est_id_tmp) - 1) ? "," : "");
    }
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn