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

复选框操作

PHP中文网
PHP中文网Original
2016-05-25 17:09:431256browse

复选框

复选框:
<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) ? "," : "");
    }
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn