What I want to do is that when I change to selection box value to "Evet",the fields on the right must be disabled.When I click on the left radio button,thetextbox must disappear.
I managed that but only for one row.But what I want to do is to apply it to all rows.I know the problem.When I create the table with the function,the loop creates the same fields name for each row.As a result,only the row at the top was working.I modified the code and tried to add numbers to the end of the names of the fields but it didnt work.And now none of the rows are working.I think I am missing something and really need help on that.By the way,u had better run the code cause I wrote a lot and u may feel confused.I would be grateful if u take a look...
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function check()
{
if(document.kutay.kat.checked==false)
{
document.kutay.maz1.style.visibility="hidden"
document.kutay.maz2.style.visibility="hidden"
}
else if(document.kutay.kat.checked==true)
{
document.kutay.maz1.style.visibility="visible"
document.kutay.maz2.style.visibility="visible"
}
}
function hide(DivID)
{
document.getElementById(DivID).style.display="none";
}
function show(DivID)
{
document.getElementById(DivID).style.display="inline";
}
function check2(id,k)
{
if(document.getElementById(id).value=='1')
{
hide('acik'+k);
hide('maz'+k);
hide('maz9'+k);
}
else if(document.getElementById(id).value=='2')
{
show('acik'+k);
show('maz'+k);
show('maz9'+k);
}
else if(document.getElementById(id).value=='3')
{
hide('acik'+k);
}
else if(document.getElementById(id).value=='4')
{
show('acik'+k);
}
}
function createtable(j)
{
for(var i=0;i<j;i++)
{
document.write("<form name='kutay'>");
document.write("<table border='1' width='980' style='font-size: 8pt; font-family: Tahoma'; 'position:static'>");
document.write("<tr>");
document.write("<td align='center' width='34' style='position:static'> <b>1</b></td>");
document.write("<td align='center' width='188' style='position:static'> <b>Kutay Kalkan</b></td>");
document.write("<td align='center' width='189' style='position:static'> <b>Taahhüt grubu</b></td>");
document.write("<td align='center' width='190' style='position:static'> <b>Muhasebe elemani</b></td>");
document.write("<td align='center' width='40' style='position:static'><select name=\"'kat'+i\" onChange=\"check2(\"''kat'+i',i\")\"><option value='1'>Evet</option><option value='2' selected>Hayir</option></select></td>");
document.write("<td align='center' width='60' style='position:static'><input type='radio' name=\"'mazeret'+i\" id=\"'maz'+i\" value='3' onClick=\"check2(\"'maz'+i\")\"></td>");
document.write("<td align='center' width='51' style='position:static'><input type='radio' name=\"'mazeret'+i\" id=\"'maz9'+i\" value='4' onClick=\"check2(\"'maz9'+i\")\"></td>");
document.write("<td align='center' width='188' style='position:static'><input type='text' size='27' id=\"'aciklama'+i\" name=\"'acik'+i\"></td>");
document.write("</tr>");
document.write("</form>");
}
}
</script>
</head>
<body>
<?
print("<table width=\"980\" height=\"21\" border=\"1\" style=\"font-size: 8pt; font-family: Tahoma\">");
print("<tr><td width=\"3\" align=\"center\"><b>No</b></td>");
print("<td align=\"center\" width=\"188\"><b>Adi_Soyadi</b></td>");
print("<td align=\"center\" width=\"189\"><b>Grubu</b></td>");
print("<td align=\"center\" width=\"190\"><b>Görevi</b></td>");
print("<td align=\"<center\" width=\"35\"><b>Katilim</b></td>");
print("<td align=\"center\" width=\"53\"><b>Mazeretsiz</b></td>");
print("<td align=\"center\" width=\"51\"><b>Mazeretli</b></td>");
print("<td align=\"center\" width=\"188\"><b>Aciklama</b></td></tr></table>");
?>
<script type="text/javascript">
createtable(10);
</script>
</body>