![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
12/10/2006, 14:37
|
| | Fecha de Ingreso: mayo-2005
Mensajes: 73
Antigüedad: 19 años, 8 meses Puntos: 0 | |
Prueba con esto... <html>
<head>
<title>Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript">
function cargavariables(nombre, codigo){
var form = document.getElementById('form1');
form.producto.value = nombre;
form.codigo.value = codigo;
}
</script>
</head>
<body>
<form id="form1" name="form1">
producto:<input type="text" id="producto" name="producto">
<p>
codigo:<input type="text" id="codigo" name="codigo">
<p>
<input type="submit" value="send">
</form>
<p>
PRODUCTOS:
<input type="button" onClick="cargavariables('tabaco', 'abc1234')" value="CAFE"> | <input type="button" onClick="cargavariables('te', 'abc1235')" value="TE"> | <input type="button" onClick="cargavariables('coca-cola', 'abc1236')" value="Coca Cola">
</body>
</html> |