Ver Mensaje Individual
  #8 (permalink)  
Antiguo 20/07/2015, 10:19
kazukyx5
 
Fecha de Ingreso: julio-2015
Ubicación: Colombia Bogota
Mensajes: 72
Antigüedad: 8 años, 9 meses
Puntos: 0
De acuerdo Respuesta: Problema con Formulario echo en php con la etiqueta <form>

Listo amigos me toco traer los formularios en estas cajas de texto aca dejo para ayudar a alguien que tengo algo similar y este perdido.
realize un nuevo form en el final donde estas cajas de texto se llenan con un php

Código PHP:
Ver original
  1. <?php
  2. mysql_connect("localhost","root","") or die("No se puede conectar");
  3. mysql_select_db("dbjeison") or die ("No se ha podido seleccionar la Base de Datos");
  4. //Recuperacion de las variables convertidas en sesiones
  5. $edo=$_SESSION['edo2']=@$_REQUEST['edo'];
  6. $str = $edo;
  7. $edo =explode('|', $str, 2);
  8.  
  9. $muni=$_SESSION['muni2']=@$_REQUEST['muni'];
  10. $str = $muni;
  11. $muni =explode('|', $str, 4);
  12.  
  13.  
  14. $col=$_SESSION['col2']=@$_REQUEST['col'];
  15. $str = $col;
  16. $col =explode('|', $str, 2);
  17.  
  18.  
  19. $dane=$_SESSION['dane2']=@$_REQUEST['dane'];
  20. $str = $dane;
  21. $dane =explode('|', $str, 2);
  22.  
  23.  
  24.  
  25. $cantidad=$_SESSION['cantidad2']=@$_REQUEST['cantidad'];
  26. $str = $cantidad;
  27. $cantidad =explode('|', $str, 2);
  28.  
  29.  
  30. ?>
  31.   <!-- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.    <!-- orden de produccion --------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
  40.  <script type="text/javascript">
  41.         function copiar()
  42.         {
  43.             document.getElementById("text2").value=document.getElementById("text1").value;
  44.             }
  45.     </script>
  46.  
  47.  <tr><td>Orden produccion</td>
  48.     <td>Orden  
  49.     <br><input type="text" name="producion" maxlength="9" size="7"  id="text1" onkeyup="copiar()" ></td>
  50. </tr>
  51.    <!-- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  52.  
  53. <form name="formulario" method="get" action="">
  54.   <!-- combo uno hace consulta en la base de datos productos ------------------------------------------------------------------------------------------------------------------------------------------->
  55.       <tr>
  56.       <td rowspan="2">Datos cliente</td>
  57.      
  58.      
  59.       <td>Producto <br>
  60. <?php
  61. //QUERY COMBO 1
  62. $query="select * from productos";
  63. $res=mysql_query($query);
  64. ?>
  65.  
  66. <select name="edo" onchange="this.form.submit()"  >          
  67.     <?php if($edo[0]!=''){  ?>
  68.     <option value="<?php echo $edo[0]."|".$edo[1]; ?>"><?php echo $edo[1]; ?></option>
  69.     <?php   } else { ?>
  70.     <option > - </option><?php }?>
  71.     <?php while($row=mysql_fetch_array($res))
  72.     {?>
  73.     <option value="<?php echo $row['codigo']."|".$row['producto']?>"> <?php echo htmlentities($row['producto']);?></option>
  74.     <?php
  75.     }
  76.     ?>
  77.  
  78. </select>
  79. </td>
  80.   <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -->
  81.  
  82.   <!-- combo dos trae los estados en select dependiente del combo uno  en tabla clientes----------------------------------------------------------------------------------------------------------------->
  83. <tr>
  84. <td>Cliente <br>  
  85. <?php
  86. //QUERY COMBO 2
  87. $query2="select * from clientes WHERE id_estado=$edo[0]";
  88. $res2=mysql_query($query2);
  89. ?>
  90.  
  91. <select name="muni"  onchange="this.form.submit()">
  92.      <?php if($muni[0]!=''){    ?>
  93.     <option value="<?php echo $muni[0]."|".$muni[1]?>"><?php echo $muni[1]; ?></option><?php    } else { ?>
  94.     <option > - </option><?php }?>
  95.         <?php while($row2=mysql_fetch_array($res2))
  96.         {
  97.         ?>
  98.         <option value="<?php echo $row2['id_cliente']."|".$row2['cliente']?>"><?php echo htmlentities($row2['cliente']);?></option>
  99.         <?php
  100.         }
  101.    
  102.    $x=$edo[1];
  103.    $x1=$muni[1];
  104.    
  105.         ?>
  106. </select>
  107. </td>
  108. </tr>
  109.  
  110.   <!------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------>
  111.  
  112.  
  113.  
  114.    <!-- consulta muestra los clientes elegidos de la base de datos dependiendo del combo 2 ----------------------------------------------------------------------------------------------------->
  115.  
  116.     <tr>
  117.       <td rowspan="2">Datos envio</td>
  118.       <td colspan=''> Destinatario  <?php
  119. $sql="SELECT  id_cliente, id_estado, cliente, direcion FROM clientes WHERE cliente = '$muni[1]'  ";
  120. $resultado=mysql_query($sql) or die
  121. ("ERROR $sql");
  122.  
  123. if (!$resultado) {
  124.     echo 'No se pudo ejecutar la consulta: ' . mysql_error();
  125.     exit;
  126. }
  127. $fila = mysql_fetch_row($resultado);
  128. echo "<br> ";
  129. //echo $fila[0]." "; // 42
  130. //echo $fila[1]." "; // el valor de email
  131. echo $fila[2]." ";
  132. echo $fila[3]." ";
  133. echo " ";
  134. ?>
  135.       </td>
  136. </tr><tr>
  137.       <td>n <?php //echo " ".$x;?> <?php //echo " ".$x1;?>   </td>
  138.       </tr>
  139.       <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -->
  140. </form>
  141.  
  142.  
  143. <form name="resformulario" method="get" action="res_formulario.php">    
  144.    
  145.       <!-- cajas habilitadas y desabilitadas --------------------------------------------------------------------------------------------------------------------------------------------------------->
  146.  
  147.     <tr>
  148.       <td rowspan="2">Distribuye</td>
  149.       <td>
  150.        Facturacion
  151.         <input type="checkbox" value="Facturacion" name="equipos1" onclick="document.resformulario.idSelect.disabled = false; document.resformulario.idInputTexto.disabled = true; idSelect.disabled = this.checked; idInputTexto.disabled = this.checked;" checked />  
  152.        <br>
  153.         Thomas Greg Expres S.A
  154.       <input type="checkbox" value="Thomas_Greg_Expres_S.A" name="equipos2" onclick="document.resformulario.idSelect.disabled = true; document.resformulario.idInputTexto.disabled = false; idSelect.disabled = !this.checked; idInputTexto.disabled = !this.checked;"  />
  155.         <br>
  156.         <select name="ele" id="idSelect">
  157.            <option value="Caja" >Caja</option>
  158.             <option value="Paquete">      Paquete</option>
  159.             <option value="Sobre">        Sobre</option>
  160.             <option value="Tula">         Tula</option>
  161.             <option value="No Aplica" selected>    No aplica</option>
  162.         </select>
  163.    
  164.      Cantidad:
  165.     <input name="can" id="idInputTexto" type="text"  maxlength="3" size="1"/>
  166.    
  167.      
  168.       </td>
  169.     </tr>
  170.     <tr>
  171.       <td>t
  172.        </td>
  173.     </tr>
  174.   <!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
  175.  
  176.  
  177.  
  178.   <!-- detalle reistros ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
  179.     <tr><td colspan='2'><center>Detalles registros</td><td colspan='2'><center>Numeracion</td></tr>
  180.    
  181.     <tr><td  vAlign="top">Cantidad  
  182.     <br><input type="text" name="cantidad" maxlength="3" size="1"></td>
  183.    
  184.     <td>Descripcion
  185.     <br><textarea name="descripcion" rows="10" cols="40"></textarea></td>
  186.    
  187.    
  188.     <td  vAlign="top"> Desde
  189.     <br><input type="text" name="inicial" maxlength="11" size="7"></td>
  190.     <td  vAlign="top">Hasta
  191.     <br><input type="text" name="final" maxlength="11" size="7"></td>
  192.    </tr>            
  193.  
  194.      <!-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  195.  
  196.  
  197. </tbody>
  198. </table>
  199.  
  200.  
  201.  
  202. <?php
  203.  
  204.  
  205. echo " ".$x;
  206. echo " ".$x1;
  207. ?>    
  208.    <input type="hidden" name="producto"  value="<?php echo htmlspecialchars($x); ?>" >
  209.     <input type="hidden" name="dircliente"  value="<?php echo htmlspecialchars($x1); ?>" >
  210.      <input type="hidden" name="copproducion" id="text2" >
  211.  
  212.      <br>
  213.      He revisado correctamente
  214.      <input type="checkbox" value="Aceptar" name="equipos2"  required />
  215.  
  216.  <!-- enviar borrar salir -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->                        
  217. <input type='submit' value='Envia'> <input type='reset' value='Restablecer'><br>
  218. <a HREF="salir.php"  TARGET=""><FONT size =" " color = '' face = ''> Salir
  219. <!-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  220. </form>
  221.  
  222. </body>
  223.  
  224. </html>