Ver Mensaje Individual
  #5 (permalink)  
Antiguo 04/03/2010, 11:37
albertibiri
 
Fecha de Ingreso: marzo-2010
Mensajes: 9
Antigüedad: 14 años, 2 meses
Puntos: 0
Respuesta: Crear formulario

Hola de nuevo, aqui teneis el codigo que tengo hasta ahora, la funcion esta de añadir no tengo ni la mas minima idea de como hacerla, es mas no se si hacerla con php o con js. Un saludo

<html>
<head>
<title>alta de productos</title>
<script language="javascript">

function añadir() {

}


</script>

<H3>Realizar Nuevo Pedido</H3>
<H3>Id_cliente
<select name="Id_cliente">
<?php
require_once('db_fns.php');
$conexion=db_connect();

$query_cliente = "SELECT * FROM clientes";
$clientes = mysql_query($query_cliente, $conexion) or die(mysql_error());
while ($registro=mysql_fetch_array($clientes)) {
?>
<option value ="<?php echo $registro["Id_cliente"]?>"><?php echo $registro["Id_cliente"]?></option>
<?php
}
?>
</select>
</H3>
<table width="346" height="57" border="1">
<tr>
<td width="200">Producto</td>
<td width="55">Cantidad</td>
<td width="69" rowspan="2"><input type="button" value="Añadir" onClick="añadir();"></td>
</tr>
<tr>
<td><select name="id_producto">
<?php
require_once('db_fns.php');
$conexion=db_connect();

$query_producto = "SELECT * FROM productos";
$productos = mysql_query($query_producto, $conexion) or die(mysql_error());
while ($registro=mysql_fetch_array($productos)) {
?>
<option value ="<?php echo $registro["id_producto"]?>"><?php echo $registro["Nombreproducto"]?></option>
<?php
}
?>
</select></td>
<td><input name="cantidad" type="text" id="cantidad" width="60" maxlength="3"></td>
</tr>
</table>
<p>&nbsp;</p>
<table width="345" border="1">
<tr>
<td>Producto</td>
<td>Cantidad</td>
<td>Eliminar</td>
</tr>
</table>
<p>&nbsp;</p>
<p>
<?php
require_once('db_fns.php');
$conexion=db_connect();
?>
<input type="submit" value="enviar">
<input type="reset" value="borrar">
</body>
</html>