php中实现一行的多个复选框的单选效果,并且批量提交多行复选框
ji程序: 在这里有一点要注意就是将id作为数组下表时,后面减整形的时候就是按减法算,但要是加的话,这个加的含义就是字符串的连接而不是加法计算比如: id=1 id-1就是0 id1就是11 所以要讲id先转换成整形parseInt(this.id); window.onload = function(){
ji程序:
在这里有一点要注意就是将id作为数组下表时,后面减整形的时候就是按减法算,但要是加的话,这个加的含义就是字符串的连接而不是加法计算比如:
id="1"
id-1就是0
id+1就是11
所以要讲id先转换成整形parseInt(this.id);
window.onload = function(){
//复选框单选效果
var che = document.getElementsByName('attendance[]');
var id = 0;
for (var i=0; i
id=parseInt(this.id);
if((this.id)%3==0&&this.checked==true){
document.getElementById(id+1).checked = false;
document.getElementById(id+2).checked = false;
} else if((this.id)%3==1&&this.checked==true){
document.getElementById(id-1).checked = false;
document.getElementById(id+1).checked = false;
} else if((this.id)%3==2&&this.checked==true){
document.getElementById(id-1).checked = false;
document.getElementById(id-2).checked = false;
}
}
}
}
html与php实现显示多行复选框
//复选框标号
$_tabIndex = 0;
可以放取数据库数据的PHP语句。一行一行取数据,决定有多少行
while(!!$_rows1=@mysql_fetch_array($_result1,MYSQL_ASSOC)){
$_a = $_tabIndex+1;
$_b = $_tabIndex+2;
?>
请假
缺勤
$_tabIndex = $_tabIndex+3;
}
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.