Foros del Web » Programando para Internet » PHP »

Input tipo text no toma valores

Estas en el tema de Input tipo text no toma valores en el foro de PHP en Foros del Web. Buenos dias, Tengo un problema muy extraño pero los input no toman los valores que se le introducen, retornan vació asi les introduzca lo que ...
  #1 (permalink)  
Antiguo 09/07/2015, 06:33
Avatar de luisdavid1993  
Fecha de Ingreso: julio-2015
Ubicación: Anaco Venezuela
Mensajes: 78
Antigüedad: 8 años, 9 meses
Puntos: 2
Información Input tipo text no toma valores

Buenos dias,
Tengo un problema muy extraño pero los input no toman los valores que se le introducen, retornan vació asi les introduzca lo que sea
__________________
"Lucha por tus sueños o alguien te contratara para que cumplas los de el"
  #2 (permalink)  
Antiguo 09/07/2015, 06:48
Avatar de xfxstudios  
Fecha de Ingreso: junio-2015
Ubicación: Valencia - Venezuela
Mensajes: 2.448
Antigüedad: 8 años, 9 meses
Puntos: 263
Respuesta: Input tipo text no toma valores

muestra el codigo, sin el no se te puede ayudar
  #3 (permalink)  
Antiguo 09/07/2015, 09:41
Avatar de luisdavid1993  
Fecha de Ingreso: julio-2015
Ubicación: Anaco Venezuela
Mensajes: 78
Antigüedad: 8 años, 9 meses
Puntos: 2
Respuesta: Input tipo text no toma valores

Código PHP:
Ver original
  1. <?php
  2.               $i;
  3.  
  4.                          
  5.                        
  6.                            
  7.                            
  8.                         echo"<form action='meto_principal.php' method='Post' name='formulario2' id='formulario2' class='table-responsive' >";
  9.                         if(count($filas2)>0){
  10.                            
  11.                           while($fila2=mysqli_fetch_array($filas2)){
  12.                    
  13.                             $i=$fila2['id'];
  14.                             echo"<tr id='$i'>";
  15.                            
  16.                              
  17.                                    
  18.  
  19.                                     $priority=$fila2['prioridad'];
  20.                                      $priority_color=$fila2['prioridad_color'];
  21.                                     echo"<td bgcolor='$priority_color'>"."<input type='text' name='prioridad+$i' id='prioridad' class='$i' value='$priority' size='1'></input>";
  22.                                     echo"</td>";
  23.                              
  24.  
  25.                                
  26.  
  27.                                     $rig=$fila2['rig'];
  28.                                     $rig_color=$fila2['rig_color'];
  29.                                     echo"<td bgcolor='$rig_color'>"." <input type='text' name='rig+$i' id='rig' value='$rig' class='$i' size='8'></input>";
  30.                                     echo"</td>";
  31.                                    
  32.                                    
  33.                                  
  34.  
  35.  
  36.  
  37.                              
  38.                                
  39.                                     $hole_size=$fila2['hole_size'];
  40.                                     $hole_size_color=$fila2['hole_size_color'];
  41.                                  
  42.                                     echo"<td bgcolor='$hole_size_color'>"."<input type='text' name='hole_size+$i'  id='hole_size' class='$i' value='$hole_size' size='3'></input>";
  43.                                     echo"</td>";
  44.                                  
  45.                                    
  46.                                    
  47.                                    
  48.                                    
  49.                                
  50.                                     $ads=$fila2['ads'];
  51.                                     $ads_color=$fila2['ads_color'];
  52.                                     echo"<td bgcolor='$ads_color' >"."<textarea name='ads+$i'  id='ads' class='$i'>$ads</textarea>";
  53.                                     echo"</td>";
  54.                                    
  55.                                    
  56.                                  
  57.                                    
  58.                                    
  59.                                    
  60.                                    
  61.                                    
  62.                              
  63.                                     $rss=$fila2['rss'];
  64.                                    $rss_color=$fila2['rss_color'];
  65.                                     echo"<td bgcolor='$rss_color'>"."<textarea name='rss+$i' id='rss' class='$i'>$rss</textarea>";
  66.                                     echo"</td>";
  67.                                  
  68.                                    
  69.  
  70.                                
  71.                                     $lwd=$fila2['lwd'];
  72.                                     $lwd_color=$fila2['lwd_color'];
  73.                                     echo"<td bgcolor='$lwd_color'>"."<textarea name='lwd+$i' id='lwd' class='$i' >$lwd</textarea> ";
  74.                                     echo"</td>";
  75.                                    
  76.                                    
  77.                                    
  78.                                     $mwd=$fila2['mwd'];
  79.                                   $mwd_color=$fila2['mwd_color'];
  80.                                     echo"<td bgcolor='$mwd_color'>"." <textarea name='mwd+$i' id='mwd'  class='$i'>$mwd</textarea>";
  81.                                     echo"</td>";
  82.                                    
  83.                                    
  84.                                    
  85.                                     $m=$fila2['m'];
  86.                                       $m_color=$fila2['m_color'];
  87.                                     echo"<td bgcolor='$m_color'>"." <input type='text' name='m+$i' id='m' class='$i' value='$m' size='1'></input>";
  88.                                     echo"</td>";
  89.                                    
  90.                                    
  91.  
  92.  
  93.                                       $s=$fila2['s'];
  94.                                     $s_color=$fila2['s_color'];
  95.                                     echo"<td bgcolor='$s_color' >"."<input type='text' name='s+$i' id='s' class='$i' value='$s' size='1'></input>";
  96.                                     echo"</td>";
  97.                                    
  98.                                    
  99.  
  100.                                       $j=$fila2['j'];
  101.                                     $j_color=$fila2['j_color'];
  102.                                     echo"<td bgcolor='$j_color'>"."<input type='text' name='j+$i' id='j' class='$i'  value='$j' size='1'></input>";
  103.                                     echo"</td>";
  104.                                  
  105.                                    
  106.                                  
  107.                                       $x=$fila2['x'];
  108.                                     $x_color=$fila2['x_color'];
  109.                                     echo"<td bgcolor='$x_color'>"."<input type='text' name='x+$i' id='x' class='$i' value='$x' size='2'></input>";
  110.                                     echo"</td>";
  111.                                    
  112.                                    
  113.                                  
  114.                                     $lr=$fila2['lr'];
  115.                                     $lr_color=$fila2['lr_color'];
  116.                                     echo"<td bgcolor='$lr_color'>"."<input type='text' name='lr+$i' id='lr' class='$i' value='$lr' size='3'></input>";
  117.                                     echo"</td>";
  118.                                  
  119.                                    
  120.                                    
  121.                                       $lf=$fila2['lf'];
  122.                                       $lf_color=$fila2['lf_color'];
  123.                                     echo"<td bgcolor='$lf_color'>"."<input type='text' name='lf+$i' id='lf' class='$i' value='$lf' size='3'></input>";
  124.                                     echo"</td>";
  125.                                    
  126.  
  127.                                     $surface=$fila2['surface'];
  128.                                      $surface_color=$fila2['surface_color'];
  129.                                     echo"<td bgcolor='$surface_color'>"."<input type='text' name='surface+$i' id='surface' class='$i' value='$surface' size='3'></input>";
  130.                                     echo"</td>";
  131.                                    
  132.                                    
  133.                                    $date=$fila2['date'];
  134.                                     $date_color=$fila2['date_color'];
  135.                                     echo"<td bgcolor='$date_color'>"."<input type='text' name='date+$i' id='date' class='$i' value='$date' size='6'></input>";
  136.                                     echo"</td>";
  137.                                  
  138.                                    
  139.                                  
  140.  
  141.                                    echo"<td>"."<input type='text' name='date' size='1'></input>";
  142.                                     echo"</td>";
  143.                                    
  144.                                    
  145.                                       $comentario=$fila2['comentario'];
  146.                                      $comentario_color=$fila2['comentario_color'];
  147.                                     echo"<td bgcolor='$comentario_color' id='com'>"."<textarea id='comentario' name='comentario+$i'class='$i'> $comentario</textarea >";
  148.                                     echo"</td>";
  149.                                    
  150.  
  151.  
  152.  
  153.  
  154.                                      $fsn=$fila2['fsn'];
  155.                                     $fsn_color=$fila2['fsn_color'];
  156.                                     echo"<td bgcolor='$fsn_color'>"."<input type='text' name='fsn+$i'  id='fsn' class='$i' value='$fsn' size='2'></input>";
  157.                                     echo"</td>";
  158.                                  
  159.                                    echo"<td >"."<a href='eliminar.php?id=$i'><button type='button' class='btn remove' id='$i' style='width:30px; height:5px'></button></a>";
  160.                                     echo"</td>";
__________________
"Lucha por tus sueños o alguien te contratara para que cumplas los de el"
  #4 (permalink)  
Antiguo 09/07/2015, 09:43
Avatar de luisdavid1993  
Fecha de Ingreso: julio-2015
Ubicación: Anaco Venezuela
Mensajes: 78
Antigüedad: 8 años, 9 meses
Puntos: 2
Respuesta: Input tipo text no toma valores

luego tengo esto

Código PHP:
Ver original
  1. echo"<input type='hidden' name='lar' value='$i' id='largo' size='2'maxlength='10' ></input>";
  2.  
  3.        
  4.                  echo"<tr class='ocultar' id='-20' >";
  5.  
  6.                             echo"<td><input type='text' name='prioridad-20' id='prioridad' class='-20'size='1'></input>";
  7.                             echo "</td>";
  8.  
  9.  
  10.                              echo"<td >"." <input type='text' name='rig-20' id='rig' class='-20'size='8'></input>";
  11.                                     echo"</td>";
  12.  
  13.                                     echo"<td>"."<input type='text' name='hole_size-20' id='hole_size' class='-20' size='3'></input>";
  14.                                     echo"</td>";
  15.  
  16.                                      echo"<td>"."<textarea name='ads-20'  id='ads' class='-20'></textarea>";
  17.                                     echo"</td>";
  18.  
  19.                                      echo"<td>"."<textarea name='rss-20' id='rss' class='-20'></textarea>";
  20.                                     echo"</td>";
  21.  
  22.                                    echo"<td>"."<textarea name='lwd-20' id='lwd' class='-20' ></textarea>";
  23.                                     echo"</td>";
  24.  
  25.                                     echo"<td>"."<textarea name='mwd-20' id='mwd'  class='-20'></textarea>";
  26.                                     echo"</td>";
  27.                                     echo"<td>"." <input type='text' name='m-20' id='m' class='-20' size='1'></input>";
  28.                                     echo"</td>";
  29.                                  
  30.  
  31.  
  32.                                    echo"<td>"."<input type='text' name='s-20' id='s' class='-20' size='1'></input>";
  33.                                     echo"</td>";
  34.                                    
  35.                                    
  36.  
  37.                      
  38.                                    
  39.                                     echo"<td>"."<input type='text' name='j-20'  id='j' class='-20' size='1'></input>";
  40.                                     echo"</td>";
  41.                                  
  42.                                    
  43.                                  
  44.                            
  45.                                    
  46.                                     echo"<td>"."<input type='text' name='x-20' id='x' class='-20' size='2'></input>";
  47.                                     echo"</td>";
  48.                                    
  49.                                    
  50.                                  
  51.                      
  52.                                    
  53.                                     echo"<td>"."<input type='text' name='lr-20' id='lr' class='-20' size='3'></input>";
  54.                                     echo"</td>";
  55.                                  
  56.                                    
  57.                                    
  58.                      
  59.                                    
  60.                                     echo"<td>"."<input type='text' name='lf-20'  id='lf' class='-20' size='3'></input>";
  61.                                     echo"</td>";
  62.                                    
  63.  
  64.                            
  65.                                    
  66.                                     echo"<td>"."<input type='text' name='surface-20' id='surface' class='-20' size='3'></input>";
  67.                                     echo"</td>";
  68.                                    
  69.                                    
  70.                        
  71.                                    
  72.                                     echo"<td>"."<input type='text' name='date-20' id='date'  class='-20' size='6'></input>";
  73.                                     echo"</td>";
  74.                                  
  75.                                    
  76.                                  
  77.  
  78.                                    echo"<td>"."<input type='text' name='flecha-20' class='-20' size='1'></input>";
  79.                                     echo"</td>";
  80.                                    
  81.                                    
  82.                      
  83.                                    
  84.                                     echo"<td id='com'>"."<textarea id='comentario' class='-20' name='comentario-20'></textarea >";
  85.                                     echo"</td>";
  86.  
  87.                                      echo"<td>"."<input type='text' name='fsn-20' id='fsn' class='-20' size='2'></input>";
  88.                                     echo"</td>";
  89.                                    
  90.                                    
  91.                                    
  92.                             echo"</tr>";
  93.  
  94.  
  95.  
  96.                             echo"<tr class='ocultar2' id='-19'>";
  97.  
  98.  
  99.                             echo"<td><input type='text' name='prioridad-19' id='prioridad' class='-19'size='1'></input>";
  100.                             echo "</td>";
  101.  
  102.  
  103.                              echo"<td >"." <input type='text' name='rig-19' id='rig' class='-19'size='8'></input>";
  104.                                     echo"</td>";
  105.  
  106.                                     echo"<td>"."<input type='text' name='hole_size-19' id='hole_size' class='-19' size='3'></input>";
  107.                                     echo"</td>";
  108.  
  109.                                      echo"<td>"."<textarea name='ads-19'  id='ads' class='-19'></textarea>";
  110.                                     echo"</td>";
  111.  
  112.                                      echo"<td>"."<textarea name='rss-19' id='rss' class='-19'></textarea>";
  113.                                     echo"</td>";
  114.  
  115.                                    echo"<td>"."<textarea name='lwd-19' id='lwd' class='-19' ></textarea>";
  116.                                     echo"</td>";
  117.  
  118.                                     echo"<td>"."<textarea name='mwd-19' id='mwd'  class='-19'></textarea>";
  119.                                     echo"</td>";
  120.                                     echo"<td>"." <input type='text' name='m-19' id='m' class='-19' size='1'></input>";
  121.                                     echo"</td>";
  122.                                  
  123.  
  124.  
  125.                                    echo"<td>"."<input type='text' name='s-19' id='s' class='-19' size='1'></input>";
  126.                                     echo"</td>";
  127.                                    
  128.                                    
  129.  
  130.                      
  131.                                    
  132.                                     echo"<td>"."<input type='text' name='j-19'  id='j' class='-19' size='1'></input>";
  133.                                     echo"</td>";
  134.                                  
  135.                                    
  136.                                  
  137.                            
  138.                                    
  139.                                     echo"<td>"."<input type='text' name='x-19' id='x' class='-19' size='2'></input>";
  140.                                     echo"</td>";
  141.                                    
  142.                                    
  143.                                  
  144.                      
  145.                                    
  146.                                     echo"<td>"."<input type='text' name='lr-19' id='lr' class='-19' size='3'></input>";
  147.                                     echo"</td>";
  148.                                  
  149.                                    
  150.                                    
  151.                      
  152.                                    
  153.                                     echo"<td>"."<input type='text' name='lf-19'  id='lf' class='-19' size='3'></input>";
  154.                                     echo"</td>";
  155.                                    
  156.  
  157.                            
  158.                                    
  159.                                     echo"<td>"."<input type='text' name='surface-19' id='surface' class='-19' size='3'></input>";
  160.                                     echo"</td>";
  161.                                    
  162.                                    
  163.                        
  164.                                    
  165.                                     echo"<td>"."<input type='text' name='date-19' id='date'  class='-19' size='6'></input>";
  166.                                     echo"</td>";
  167.                                  
  168.                                    
  169.                                  
  170.  
  171.                                    echo"<td>"."<input type='text' name='flecha-19' class='-19' size='1'></input>";
  172.                                     echo"</td>";
  173.                                    
  174.                                    
  175.                      
  176.                                    
  177.                                     echo"<td id='com'>"."<textarea id='comentario' class='-19' name='comentario-19'></textarea >";
  178.                                     echo"</td>";
  179.  
  180.                                      echo"<td>"."<input type='text' name='fsn-19' id='fsn' class='-19' size='2'></input>";
  181.                                     echo"</td>";
  182.                                    
  183.  
  184.                                    
  185.                                    
  186.                             echo"</tr>";
__________________
"Lucha por tus sueños o alguien te contratara para que cumplas los de el"
  #5 (permalink)  
Antiguo 09/07/2015, 09:48
Avatar de luisdavid1993  
Fecha de Ingreso: julio-2015
Ubicación: Anaco Venezuela
Mensajes: 78
Antigüedad: 8 años, 9 meses
Puntos: 2
Respuesta: Input tipo text no toma valores

luego de eso finalizo el php

Código PHP:
Ver original
  1. echo"<tr class='ocultar' id='-20' >";
  2. echo"<tr class='ocultar' id='-19' >";

los oculto con css y luego los hago aparecer con un botón
y no son loso esos dos son 10 en total... no conseguía la forma de agregar dinamicamente filas y que hicieran todo lo que quiero
__________________
"Lucha por tus sueños o alguien te contratara para que cumplas los de el"
  #6 (permalink)  
Antiguo 09/07/2015, 09:49
Avatar de luisdavid1993  
Fecha de Ingreso: julio-2015
Ubicación: Anaco Venezuela
Mensajes: 78
Antigüedad: 8 años, 9 meses
Puntos: 2
Respuesta: Input tipo text no toma valores

aqui esta el script donde hago los insert y update

Código PHP:
Ver original
  1. <?php
  2.  
  3. include'conexion.php';
  4. $con=conectar();
  5.  
  6. $largo=$_POST['lar'];
  7.  
  8. $query="";
  9. $dos="";
  10.  
  11.         for($i=1;$i<=$largo;$i++){
  12.  
  13.                         if (isset($_POST["prioridad+$i"])) {
  14.                         $pri=$_POST["prioridad+$i"];
  15.                    
  16.                         } else {
  17.                         $pri = "";
  18.                        
  19.                         }
  20.  
  21.  
  22.                         if (isset($_POST["rig+$i"])) {
  23.                         $rig=$_POST["rig+$i"];
  24.                            
  25.                         } else {
  26.                         $rig = "";
  27.                    
  28.                         }
  29.  
  30.                         if (isset($_POST["hole_size+$i"])) {
  31.                         $hole=$_POST["hole_size+$i"];
  32.                         } else {
  33.                         $hole = "";
  34.                            
  35.                         }
  36.  
  37.                         if (isset($_POST["ads+$i"])) {
  38.                         $ads=$_POST["ads+$i"];
  39.                         } else {
  40.                         $ads = "";
  41.                         }
  42.  
  43.                         if (isset($_POST["rss+$i"])) {
  44.                         $rss=$_POST["rss+$i"];
  45.                         } else {
  46.                         $rss = "";
  47.                         }
  48.  
  49.  
  50.  
  51.  
  52.                         if (isset($_POST["lwd+$i"])) {
  53.                         $lwd=$_POST["lwd+$i"];
  54.                         } else {
  55.                         $lwd = "";
  56.                         }
  57.  
  58.                         if (isset($_POST["mwd+$i"])) {
  59.                         $mwd=$_POST["mwd+$i"];
  60.                         } else {
  61.                         $mwd = "";
  62.                         }
  63.  
  64.                         if (isset($_POST["m+$i"])) {
  65.                         $m=$_POST["m+$i"];
  66.                         } else {
  67.                         $m = "";
  68.                         }
  69.  
  70.                         if (isset($_POST["s+$i"])) {
  71.                         $s=$_POST["s+$i"];
  72.                         } else {
  73.                         $s="";
  74.                         }
  75.  
  76.                         if (isset($_POST["j+$i"])) {
  77.                         $j=$_POST["j+$i"];
  78.                         } else {
  79.                         $j="";
  80.                         }
  81.  
  82.  
  83.                         if (isset($_POST["x+$i"])) {
  84.                         $x=$_POST["x+$i"];
  85.                         } else {
  86.                         $x="";
  87.                         }
  88.  
  89.  
  90.  
  91.                         if (isset($_POST["lr+$i"])) {
  92.                         $lr=$_POST["lr+$i"];
  93.                         } else {
  94.                         $lr="";
  95.                         }
  96.  
  97.  
  98.                         if (isset($_POST["lf+$i"])) {
  99.                         $lf=$_POST["lf+$i"];
  100.                         } else {
  101.                         $lf="";
  102.                         }
  103.  
  104.  
  105.                         if (isset($_POST["surface+$i"])) {
  106.                         $surface=$_POST["surface+$i"];
  107.                         } else {
  108.                         $surface="";
  109.                         }
  110.  
  111.                         if (isset($_POST["date+$i"])) {
  112.                         $date=$_POST["date+$i"];
  113.                         } else {
  114.                         $date="";
  115.                         }
  116.  
  117.                         if (isset($_POST["comentario+$i"])) {
  118.                         $comentario=$_POST["comentario+$i"];
  119.                         } else {
  120.                         $comentario="";
  121.                         }
  122.  
  123.  
  124.                         if (isset($_POST["fsn+$i"])) {
  125.                         $fsn=$_POST["fsn+$i"];
  126.                         } else {
  127.                         $fsn="";
  128.                         }
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                        
  137.                         $sql="update registro set prioridad='$pri',rig='$rig',hole_size='$hole',ads='$ads',rss='$rss',lwd='$lwd',mwd='$mwd',m='$m',s='$s',j='$j',x='$x',lr='$lr',lf='$lf',surface='$surface',date='$date',comentario='$comentario',fsn='$fsn' where id='$i'";
  138.  
  139.                         ini_set('max_execution_time', 300);
  140.                         $query=mysqli_query($con,$sql);
  141.  
  142.  
  143.                    
  144.  
  145.                         }
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.     for($j=-20;$j<-10;$j++){
  154.                 if(isset($_POST["prioridad$j"])or isset($_POST["rig$j"]) or isset($_POST["hole_size$j"]) or isset($_POST["ads$j"]) or isset($_POST["rss$j"]) or isset($_POST["lwd$j"]) or isset($_POST["mwd$j"]) or isset($_POST["m$j"]) or isset($_POST["s$j"]) or isset($_POST["j$j"]) or isset($_POST["x$j"]) or isset($_POST["lr$j"]) or isset($_POST["lf$j"]) or isset($_POST["surface$j"]) or isset($_POST["date$j"]) or isset($_POST["comentario$j"]) or isset($_POST["fsn$j"]) ){
  155.  
  156.  
  157.                         if($_POST["prioridad$j"]!='' or $_POST["rig$j"]!='' or $_POST["hole_size$j"]!='' or $_POST["ads$j"]!='' or $_POST["rss$j"]!='' or $_POST["lwd$j"]!='' or $_POST["mwd$j"]!='' or $_POST["m$j"]!='' or $_POST["s$j"]!=''  or $_POST["j$j"]!='' or $_POST["x$j"]!='' or $_POST["lr$j"]!='' or $_POST["lf$j"]!='' or $_POST["surface$j"]!='' or $_POST["date$j"]!='' or $_POST["comentario$j"]!='' or $_POST["fsn$j"]!='' ){
  158.  
  159.                     $largo++;
  160.                    
  161.  
  162.  
  163.  
  164.  
  165.                             if (isset($_POST["prioridad$j"])) {
  166.                         $pri2=$_POST["prioridad$j"];
  167.                         } else {
  168.                         $pri2="";
  169.                         }
  170.            
  171.  
  172.                             if (isset($_POST["rig$j"])) {
  173.                         $rig2=$_POST["rig$j"];
  174.                             } else {
  175.                         $rig2="";
  176.                         }
  177.            
  178.  
  179.                         if (isset($_POST["hole_size$j"])) {
  180.                         $hole2=$_POST["hole_size$j"];
  181.                                 } else {
  182.                         $hole2="";
  183.                         }
  184.            
  185.  
  186.                         if (isset($_POST["ads$j"])) {
  187.                         $ads2=$_POST["ads$j"];
  188.                                     } else {
  189.                         $ads2="";
  190.                         }
  191.            
  192.  
  193.                         if (isset($_POST["rss$j"])) {
  194.                         $rss2=$_POST["rss$j"];
  195.                         } else {
  196.                         $rss2="";
  197.                         }
  198.            
  199.  
  200.  
  201.  
  202.  
  203.                         if (isset($_POST["lwd$j"])) {
  204.                         $lwd2=$_POST["lwd$j"];
  205.                         } else {
  206.                         $lwd2 ="";
  207.                         }
  208.  
  209.                         if (isset($_POST["mwd$j"])) {
  210.                         $mwd2=$_POST["mwd$j"];
  211.                         } else {
  212.                         $mwd2="";
  213.                         }
  214.  
  215.                         if (isset($_POST["m$j"])) {
  216.                         $m2=$_POST["m$j"];
  217.                         } else {
  218.                         $m2="";
  219.                         }
  220.  
  221.                         if (isset($_POST["s$j"])) {
  222.                         $s2=$_POST["s$j"];
  223.                         } else {
  224.                         $s2="";
  225.                         }
  226.  
  227.                         if (isset($_POST["j$j"])) {
  228.                         $j2=$_POST["j$j"];
  229.                         } else {
  230.                         $j2="";
  231.                         }
  232.  
  233.  
  234.                         if (isset($_POST["x$j"])) {
  235.                         $x2=$_POST["x$j"];
  236.                         } else {
  237.                         $x2="";
  238.                         }
  239.  
  240.  
  241.  
  242.                         if (isset($_POST["lr$j"])) {
  243.                         $lr2=$_POST["lr$j"];
  244.                         } else {
  245.                         $lr2="";
  246.                         }
  247.  
  248.  
  249.                         if (isset($_POST["lf$j"])) {
  250.                         $lf2=$_POST["lf$j"];
  251.                         } else {
  252.                         $lf2="";
  253.                         }
  254.  
  255.  
  256.                         if (isset($_POST["surface$j"])) {
  257.                         $surface2=$_POST["surface$j"];
  258.                         } else {
  259.                         $surface2="";
  260.                         }
  261.  
  262.                         if (isset($_POST["date$j"])) {
  263.                         $date2=$_POST["date$j"];
  264.                         } else {
  265.                         $date2="";
  266.                         }
  267.  
  268.                         if (isset($_POST["comentario$j"])) {
  269.                         $comentario2=$_POST["comentario$j"];
  270.                         } else {
  271.                         $comentario2="";
  272.                         }
  273.  
  274.  
  275.                         if (isset($_POST["fsn$j"])) {
  276.                         $fsn2=$_POST["fsn$j"];
  277.                         } else {
  278.                         $fsn2="";
  279.                         }
  280.                        
  281.                     $sql2="insert into registro(id,prioridad,rig,hole_size,ads,rss,lwd,mwd,m,s,j,x,lr,lf,surface,date,comentario,fsn) values($largo,'$pri2','$rig2','$hole2','$ads2','$rss2','$lwd2','$mwd2','$m2','$s2','$j2','$x2','$lr2','$lf2','$surface2','$date2','$comentario2','$fsn2')";
  282.                         ini_set('max_execution_time', 300);
  283.  
  284.                     $dos=mysqli_query($con,$sql2);
  285.  
  286.                 }
  287.  
  288.                 }
  289.  
  290.     }
  291.  
  292.                        
  293.  
  294.                        
  295.  
  296.  
  297.                        
  298.  
  299.                    
  300.                         if (!$query&&!$dos) {die('Error: ' . mysql_error());
  301.                         }else{
  302.                             echo"<script type='text/javascript'> window.location='principal.php'</script>";
  303.                                 }
  304.  
  305.  
  306.  
  307.  
  308. ?>
__________________
"Lucha por tus sueños o alguien te contratara para que cumplas los de el"
  #7 (permalink)  
Antiguo 09/07/2015, 10:43
Avatar de xfxstudios  
Fecha de Ingreso: junio-2015
Ubicación: Valencia - Venezuela
Mensajes: 2.448
Antigüedad: 8 años, 9 meses
Puntos: 263
Respuesta: Input tipo text no toma valores

con este script te ahoras un trabajon duplicando las filas que necesites:
Código Javascript:
Ver original
  1. // <![CDATA[
  2.  
  3. var posicionCampo = 1;
  4.  
  5.  
  6. function agregarUsuario() {
  7.  
  8.     nuevaFila = document.getElementById("tablatracking").insertRow(-1);
  9.  
  10.     nuevaFila.id = posicionCampo;
  11.  
  12.     nuevaCelda = nuevaFila.insertCell(-1);
  13.  
  14.     nuevaCelda.innerHTML = "<td><textarea cols='50' name='requisito[" + posicionCampo + "]' value='' placeholder=' Requisito...' required></textarea></td>";
  15.    
  16.     nuevaCelda = nuevaFila.insertCell(-1);
  17.  
  18.     nuevaCelda.innerHTML = "<td><input type='hidden' size='1' name='rif[" + posicionCampo + "]' value='<?php echo $rif ?>'></td>";
  19.  
  20.     nuevaCelda = nuevaFila.insertCell(-1);
  21.    
  22.     nuevaCelda.innerHTML = "<td><input type='hidden' size='15' name='unidad_explot[" + posicionCampo + "]' value='<?php echo $unidad ?>'/></td>";
  23.  
  24.     nuevaCelda = nuevaFila.insertCell(-1);
  25.  
  26.     nuevaCelda.innerHTML = "<td><input type='button' id='eliminar' value='Eliminar' onclick='eliminarUsuario(this)' class='btn btn-danger'></td>";
  27.  
  28.  
  29. /*    nuevaCelda = nuevaFila.insertCell(-1);
  30.    
  31.     nuevaCelda.innerHTML = "<td><input type='hidden' size='1' name='cedula[" + posicionCampo + "]' value='<'/></td>";
  32.  
  33.     nuevaCelda = nuevaFila.insertCell(-1);
  34.    
  35.     nuevaCelda.innerHTML = "<td><input type='hidden' size='1' name='estatus[" + posicionCampo + "]' value='En Transito'/></td>";
  36.  
  37.     nuevaCelda = nuevaFila.insertCell(-1);
  38.    
  39.     nuevaCelda.innerHTML = "<td><input type='hidden' size='1' name='lugar[" + posicionCampo + "]' value='No_entregado'/></td>";
  40.  
  41.     nuevaCelda = nuevaFila.insertCell(-1);
  42.    
  43.     nuevaCelda.innerHTML = "<td><input type='hidden' size='1' name='fecha_registro[" + posicionCampo + "]' value=''/></td>";
  44.  
  45.     nuevaCelda = nuevaFila.insertCell(-1);
  46.    
  47.     nuevaCelda.innerHTML = "<td><input type='hidden' size='1' name='fecha_estatus[" + posicionCampo + "]' value=''/></td>";*/
  48.  
  49.     posicionCampo++;
  50.  
  51. }
  52.  
  53.  
  54. function eliminarUsuario(obj) {
  55.  
  56.     var oTr = obj;
  57.  
  58.     while(oTr.nodeName.toLowerCase() != 'tr') {
  59.  
  60.         oTr=oTr.parentNode;
  61.  
  62.     }
  63.  
  64.     var root = oTr.parentNode;
  65.  
  66.     root.removeChild(oTr);
  67.  
  68. }
este escript te crea filas conforme las vallas necesitando y te agrega un boton con el cual puedes eliminar la fila que necesites
y este es la tabla formulario en la cual se repiten las filas:
Código HTML:
Ver original
  1. <form action="exito_carga_requi.php" method="POST" enctype="multipart/form-data"><table id="tablatracking">
  2.         <tbody>
  3.          <tr>
  4.                 <td align="left"><input onclick="agregarUsuario()" type="button" value="Agregar Requisito" id="boton_agregar" class="btn btn-success"></td>
  5.           </tr>
  6.             <tr>
  7.               <td width="100" id="titulo">Requisito</td>
  8.               <td width="50"></td>
  9.                 <td width="33"></td>
  10.                 <td width="33"></td>
  11.             </tr>
  12.         </tbody>
  13.     </table>
  14.     <input type="submit" value="Registrar" id="boton_enviar" class="btn btn-warning" />
  15.   </form>
  #8 (permalink)  
Antiguo 09/07/2015, 10:44
Avatar de xfxstudios  
Fecha de Ingreso: junio-2015
Ubicación: Valencia - Venezuela
Mensajes: 2.448
Antigüedad: 8 años, 9 meses
Puntos: 263
Respuesta: Input tipo text no toma valores

con este otro recibo los valores que me envia el formulario de filas repetidas, las ordeno y las almaceno en la base de datos:
Código PHP:
Ver original
  1. if($_POST['requisito']=="")
  2. {
  3.     $msg = "El formulario se envio vacio";
  4. }
  5. else {
  6. $requisito = array();
  7. $rif = array();
  8. $unidad_explot = array();
  9.  
  10. foreach($_POST['requisito'] as $key=>$value)
  11.     $requisito[]= $value;
  12.  
  13. foreach($_POST['rif'] as $key=>$value)
  14.     $rif[]= $value;
  15.    
  16. foreach($_POST['unidad_explot'] as $key=>$value)
  17.     $unidad_explot[]= $value;
  18.    
  19. $conexion= mysql_connect($hostname_seguridad, $username_seguridad, $password_seguridad);
  20. mysql_select_db($database_seguridad, $conexion);
  21.  
  22.  for($i=0; $i<count($requisito); $i++)
  23.  {
  24.  
  25. mysql_query("INSERT INTO config_requisitos (requisito, rif, unidad_explot) VALUES('$requisito[$i]' , '$rif[$i]' , '$unidad_explot[$i]')",$conexion)or die(mysql_error());
  26. $msg ="¡Gracias!, Hemos recibido la información, puedes verificar en la sección de seguimiento";
  27.  }
  28. }
  #9 (permalink)  
Antiguo 09/07/2015, 11:42
Avatar de luisdavid1993  
Fecha de Ingreso: julio-2015
Ubicación: Anaco Venezuela
Mensajes: 78
Antigüedad: 8 años, 9 meses
Puntos: 2
Respuesta: Input tipo text no toma valores

Gracias me gusto tu código...
__________________
"Lucha por tus sueños o alguien te contratara para que cumplas los de el"

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:54.