JavaScript - evento no funciona

 
Vista:
Imágen de perfil de Hfr

evento no funciona

Publicado por Hfr (29 intervenciones) el 09/03/2016 22:05:48
hola chicos, tengo este problema, con php dibujo 10 campos y os dejo des habilitados,
y con js estaba creando un evento para des habilitar los campos en la diversas posiciones , pero me esta quedando rarro..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php $valor=10; ?>
<html>
<head>
 
 
<link rel="stylesheet" href="ventana.css">
 
<script languaje="javascript">
 
function habilitar(form)
 
{
 
 
 
if (form.campod.disabled== true)
 
	{
 
 var va="<?php echo $valor; ?>";
 
	for (x=1; x<=va; x++)
		{
	form.campo[x].disabled=false;
 
		}
 
return false;
}
}
	</script>
 
 
</head>
<body>
 
<form  action="#" method="POST">
 
campo xx <input type="text" name ="campos" id="campod"  disabled > <br>
<?php  for ($x=1; $x<=$valor;  $x++) {?>
 
 
campo <?php  echo $x; ?>   <input type="text" name="campo<?php echo $x; ?>" value=""  disabled>
<br>
<?php } ?>
 
 
 
 
<br>
<input value="click"  onclick="return habilitar(this.form);" type="submit">
 
</form>
 
 
 
</body>
 
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder