said_fox
04-24-2003, 05:40 PM
getElementById("theid")
assign all elements of the same id value in an array. Is this true?.
So please till me why this script does not work properly?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript" type="text/javascript">
function mafox(gla)
{
tonl=document.getElementById("t1");
conl=document.getElementById("c1");
x=0;
alert(x);
do
{
alert(conl[x].value);
if (conl[x]==gla){
alert(x);
}
x++;
}
while(x<conl.length)
}
</script>
<title>ToForm</title>
</head>
<body>
<form action="form2.php" method="post" name="f1">
<?
for ($i = 0; $i < 10; ++$i)
{
?>
<input type="text" name="txt[]" value="<?=$i?>" id="t1" >
<input type="text" name="txt1[]" value="<?=$i?>" id="t1" >
<input type="checkbox" value="y<?=$i?>" name="chk[]" id="c1" onMouseOver="mafox(this)">
<input type="hidden" name="hide[]" value="y<?=$i?>">
Chhos Num <?=$i?><br>
<?}
?>
<input type="submit">
</form>
</body>
</html>
So please what's wrong I did?:mad: :mad: :confused:
assign all elements of the same id value in an array. Is this true?.
So please till me why this script does not work properly?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript" type="text/javascript">
function mafox(gla)
{
tonl=document.getElementById("t1");
conl=document.getElementById("c1");
x=0;
alert(x);
do
{
alert(conl[x].value);
if (conl[x]==gla){
alert(x);
}
x++;
}
while(x<conl.length)
}
</script>
<title>ToForm</title>
</head>
<body>
<form action="form2.php" method="post" name="f1">
<?
for ($i = 0; $i < 10; ++$i)
{
?>
<input type="text" name="txt[]" value="<?=$i?>" id="t1" >
<input type="text" name="txt1[]" value="<?=$i?>" id="t1" >
<input type="checkbox" value="y<?=$i?>" name="chk[]" id="c1" onMouseOver="mafox(this)">
<input type="hidden" name="hide[]" value="y<?=$i?>">
Chhos Num <?=$i?><br>
<?}
?>
<input type="submit">
</form>
</body>
</html>
So please what's wrong I did?:mad: :mad: :confused: