Ver Mensaje Individual
  #26 (permalink)  
Antiguo 01/10/2013, 08:43
Avatar de Dalam
Dalam
 
Fecha de Ingreso: septiembre-2010
Mensajes: 409
Antigüedad: 13 años, 8 meses
Puntos: 56
Respuesta: Mostrar valor 0 en input

Lo mas facil esque le escribas a la tabla manualmente el primer valor con 0 de esta forma
Código PHP:
<th><select name="producto" id="producto" maxlength="10" onchange="document.getElementById('precio').value=this.options[this.selectedIndex].getAttribute('producto'); actualizar_importe()" required="required">
                    <?php
$qry
=mysql_query("select * from productos");
$row=array();
while(
$r=mysql_fetch_assoc($qry)){
$row[]=array($r['cod_producto'],$r['producto'],$r['precio']);

                      echo 
'<option  producto="no" value="0">-- ELIJE PRODUCTO --</option>';
                      foreach(
$row as $v){ ?>
                    <option  producto="<?php echo $v[2?>" value="<?php echo $v[0?>"><?php echo $v[1?></option>
                    <?php }?>
                  </select></th>
                  <th><input type="text" name="precio" id="precio" value="<?php echo $row[2][2]."\n" ?>" onchange="actualizar_importe()" readonly="readonly"/></th>