
10/05/2012, 17:30
|
| | Fecha de Ingreso: noviembre-2004 Ubicación: Medellín
Mensajes: 121
Antigüedad: 20 años, 4 meses Puntos: 1 | |
onClick no funciona Buenas noches, estoy haciendo un programa y como soy novato con javascript lo estoy haciendo poco a poco, para probar. Tengo un botón que al hacer clic debería cambiar el valor de un textBox, pero no lo hace. ¿Me podrían decir por qué?
<script language = "javascript" type="text/javascript">
function incrementar(){
document.form1.tx1.value="1";
//alert("A");
}
</script>
</head>
<body>
<table width="614" border="1">
<tr>
<td width="106">6 am - 2:30 pm</td>
<td width="13"> </td>
<td width="87"><form id="form1" name="form1" method="post" action="">
<label>
<input type="button" name="1" id="1" value="Agregar" onClick="incrementar();"/>
</label>
</form></td>
<td width="16"> </td>
<td width="144"><label>
<input type="text" name="tx1" id="tx1" value="0"/>
</label></td>
<td width="9"> </td>
<td width="193"><input type="text" name="tx3" id="tx3" value="0"/></td>
</tr>
<tr>
<td>6 am - 14:30 pm</td>
<td> </td>
<td><input type="button" name="2" id="2" value="Agregar" /></td>
<td> </td>
<td><input type="text" name="tx2" id="tx2" value="0"/></td>
<td> </td>
<td><input type="text" name="tx4" id="tx4" value="0"/></td>
</tr>
</table>
<p>
<input type="button" name="12" id="12" value="De nuevo" />
</p>
<p> </p>
</body>
</html> |