ถึงคุณ JezusMitsui ขอรบกวนอีกหน่อยครับผม ที่คุณ JezusMitsui ช่วยผมทำ textbox เป็น group เวลาเลือกกรุ๊ปไหนกรุ๊ปที่เหลือจะล็อกนั้น
กระทู้ที่ [4827] ครับ url มันเป็นหน้ารวมกระทู้โทษทีครับ
Date :
25 ก.ค. 2548 02:31:58
By :
beeoo
ผมแก้แล้วก็ประมาณนี้ การทำงานก็ถูกต้อง..!!! ไม่รู้ว่าใช้ IE หรือเปล่า
=========================================================
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<script language="javascript" type="text/javascript">
function doChoose(index){
switch(parseInt(index)){
case 1:
setTextboxReadOnly(false,'txtGroup11','txtGroup12','txtGroup13','txtGroup14','txtGroup15','txtGroup16','txtGroup17','txtGroup18');
setTextboxReadOnly(true,'txtGroup21','txtGroup22','txtGroup23','txtGroup24','txtGroup25','txtGroup26','txtGroup27','txtGroup28');
setTextboxReadOnly(true,'txtGroup31','txtGroup32','txtGroup33','txtGroup34','txtGroup35','txtGroup36','txtGroup37','txtGroup38');
break;
case 2:
setTextboxReadOnly(true,'txtGroup11','txtGroup12','txtGroup13','txtGroup14','txtGroup15','txtGroup16','txtGroup17','txtGroup18');
setTextboxReadOnly(false,'txtGroup21','txtGroup22','txtGroup23','txtGroup24','txtGroup25','txtGroup26','txtGroup27','txtGroup28');
setTextboxReadOnly(true,'txtGroup31','txtGroup32','txtGroup33','txtGroup34','txtGroup35','txtGroup36','txtGroup37','txtGroup38');
break;
case 3:
setTextboxReadOnly(true,'txtGroup11','txtGroup12','txtGroup13','txtGroup14','txtGroup15','txtGroup16','txtGroup17','txtGroup18');
setTextboxReadOnly(true,'txtGroup21','txtGroup22','txtGroup23','txtGroup24','txtGroup25','txtGroup26','txtGroup27','txtGroup28');
setTextboxReadOnly(false,'txtGroup31','txtGroup32','txtGroup33','txtGroup34','txtGroup35','txtGroup36','txtGroup37','txtGroup38');
break;
default:
setTextboxReadOnly(true,'txtGroup11','txtGroup12','txtGroup13','txtGroup14','txtGroup15','txtGroup16','txtGroup17','txtGroup18');
setTextboxReadOnly(true,'txtGroup21','txtGroup22','txtGroup23','txtGroup24','txtGroup25','txtGroup26','txtGroup27','txtGroup28');
setTextboxReadOnly(true,'txtGroup31','txtGroup32','txtGroup33','txtGroup34','txtGroup35','txtGroup36','txtGroup37','txtGroup38');
}
}
function setTextboxReadOnly(){
var arg = arguments;
if (arg.length>1)
{
for (i=1;i<arg.length;i++){
var obj = document.getElementsByName(arg)[0];
if (obj) obj.readOnly = arg[0];
}
}
}
</script>
</head>
<body onLoad="doChoose(0)">
<form name="form1" method="post" action="">
Choose to Enable Textbox Group
<select name="select" onChange="doChoose(this.options[this.selectedIndex].value)">
<option value="0">Select Enable Group</option>
<option value="1">Group1</option>
<option value="2">Group2</option>
<option value="3">Group3</option>
</select>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
Group#1 </td>
<td>Group#2</td>
<td>Group#3</td>
</tr>
<tr>
<td><input name="txtGroup11" type="text" id="txtGroup11" value="txtGroup11"></td>
<td><input name="txtGroup21" type="text" id="txtGroup21" value="txtGroup21"></td>
<td><input name="txtGroup31" type="text" id="txtGroup31" value="txtGroup31"></td>
</tr>
<tr>
<td><input name="txtGroup12" type="text" id="txtGroup12" value="txtGroup12"></td>
<td><input name="txtGroup22" type="text" id="txtGroup22" value="txtGroup22"></td>
<td><input name="txtGroup32" type="text" id="txtGroup32" value="txtGroup32"></td>
</tr>
<tr>
<td><input name="txtGroup13" type="text" id="txtGroup13" value="txtGroup13"></td>
<td><input name="txtGroup23" type="text" id="txtGroup23" value="txtGroup23"></td>
<td><input name="txtGroup33" type="text" id="txtGroup33" value="txtGroup33"></td>
</tr>
<tr>
<td><input name="txtGroup14" type="text" id="txtGroup14" value="txtGroup14"></td>
<td><input name="txtGroup24" type="text" id="txtGroup24" value="txtGroup24"></td>
<td><input name="txtGroup34" type="text" id="txtGroup34" value="txtGroup34"></td>
</tr>
<tr>
<td><input name="txtGroup15" type="text" id="txtGroup15" value="txtGroup15"></td>
<td><input name="txtGroup25" type="text" id="txtGroup25" value="txtGroup25"></td>
<td><input name="txtGroup35" type="text" id="txtGroup35" value="txtGroup35"></td>
</tr>
<tr>
<td><input name="txtGroup16" type="text" id="txtGroup16" value="txtGroup16"></td>
<td><input name="txtGroup26" type="text" id="txtGroup26" value="txtGroup26"></td>
<td><input name="txtGroup36" type="text" id="txtGroup36" value="txtGroup36"></td>
</tr>
<tr>
<td><input name="txtGroup17" type="text" id="txtGroup17" value="txtGroup17"></td>
<td><input name="txtGroup27" type="text" id="txtGroup27" value="txtGroup27"></td>
<td><input name="txtGroup37" type="text" id="txtGroup37" value="txtGroup37"></td>
</tr>
<tr>
<td><input name="txtGroup18" type="text" id="txtGroup18" value="txtGroup18"></td>
<td><input name="txtGroup28" type="text" id="txtGroup28" value="txtGroup28"></td>
<td><input name="txtGroup38" type="text" id="txtGroup38" value="txtGroup38"></td>
</tr>
</table>
</form>
</body>
</html>
Date :
26 ก.ค. 2548 14:18:03
By :
JezusMitsui
Load balance : Server 05