
como crear un input text en cada fila
Publicado por hector (1 intervención) el 06/10/2016 20:43:26

alguien me puede ayudar necesito que el boton de insertar em salga asi como esta en la imagen en cada fila pero q sea de tipo text para poder agregar cada aspecto en cada una de las filas no al final como lo tengo les agradesco su ayuda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>anexo 2</title>
<link href="estilos2.css" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<!-- VALIDAR DATOS QUE SOLO RECIBA LETRAS -->
<script>
function soloLetras(e){
key = e.keyCode || e.which;
tecla = String.fromCharCode(key).toLowerCase();
letras = " áéíóúabcdefghijklmnñopqrstuvwxyz";
especiales = "8-37-39-46";
tecla_especial = false
for(var i in especiales){
if(key == especiales[i]){
tecla_especial = true;
break;
}
}
if(letras.indexOf(tecla)==-1 && !tecla_especial){
return false;
}
}
</script>
<body>
<?php
include("conexion.php");
$conexion=$base->query("SELECT Nom_Asp_Amb,Nom_Proceso,Nom_Actividad,Nom_Area_Incid FROM aspectos_ambientales RIGHT JOIN actividad ON aspectos_ambientales.id_Asp_Amb = actividad.id_Actividad RIGHT JOIN proceso ON actividad.id_Actividad = proceso.id_Proceso RIGHT JOIN area_incidencia ON actividad.id_Actividad = area_incidencia.id_Area_Incid");
$registros=$conexion->fetchAll(PDO::FETCH_OBJ);
if(isset($_POST["enviar"])){
$aspecto=$_POST["asp"];
$sql="INSERT INTO aspectos_ambientales (Nom_Asp_Amb) values (:asp)";
$resultado=$base->prepare($sql);
$resultado->execute(array(":asp"=>$aspecto));
header("Location:index.php");
}
?>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<h1 id="titulo" >REGISTRO DE ASPECTOS AMBIENTALES IDENTIFICADOS</h1>
<div class="container">
<table class="table table-reflow table-bordered table-condensed" id="tabla">
<thead>
<tr class="active">
<th rowspan="2">ASPECTOS AMBIENTALES </th>
<th rowspan="2">PROCESOS<br></th>
</tr>
<tr class="active">
<th id="tipo1">ACTIVIDAD</th>
<th id="tipo2">AREA DE INSIDENCIA</th>
</tr>
</thead>
<tbody>
<?php
foreach($registros as $persona):?>
<tr>
<td><?php echo $persona->Nom_Asp_Amb?></td>
<td><?php echo $persona->Nom_Proceso?></td>
<td><?php echo $persona->Nom_Actividad?></td>
<td><?php echo $persona->Nom_Area_Incid?></td>
</tr>
<?php
endforeach;
?>
<tr>
<td><input type="text" name="asp" class='form-control' placeholder="Aspecto Ambiental" required="" onkeypress="return soloLetras(event)" onpaste="return false"></td>
<td class='bot'><input type='submit' name='enviar' id='enviar' value='Insertar' class="btn btn-success"></td>
</tr>
</tbody>
</table>
</form>
</div>
</body>
</html>
Valora esta pregunta


0