PHP - funcion para desabiltar campos y select

 
Vista:

funcion para desabiltar campos y select

Publicado por Karolina (10 intervenciones) el 04/12/2019 01:05:21
Hola bendiciones. Si me pueden ayudar en esto. Estoy haciendo un formulario para insertar datos en mi bases de datos y estoy empleando una función para desabiltar campos y select, pero no logro obtener los valores de estos campos (TIPO_TARJETA, BANCO, REF, MONTO, NRO_APROBACION)
para almacenar en mi BD.

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
<script type="text/javascript">
function activar1(){
var primero=document.getElementById("text1").disabled= false;
var segundo=document.getElementById("text2").disabled= false;
var tercero=document.getElementById("BANCO").disabled= false;
var tercero=document.getElementById("TIPO_TARJETA").disabled= false;
var tercero=document.getElementById("REF").disabled= false;
var tercero=document.getElementById("MONTO").disabled= false;
var tercero=document.getElementById("NRO_APROBACION").disabled= false;
}
function activar2(){
var primero=document.getElementById("text1").disabled= true;
var segundo=document.getElementById("text2").disabled= false;
var tercero=document.getElementById("BANCO").disabled= true;
var tercero=document.getElementById("TIPO_TARJETA").disabled= true;
var tercero=document.getElementById("REF").disabled= true;
var tercero=document.getElementById("MONTO").disabled= true;
var tercero=document.getElementById("NRO_APROBACION").disabled= true;
}
function activar3(){
var primero=document.getElementById("text1").disabled= true;
var segundo=document.getElementById("text2").disabled= true;
var tercero=document.getElementById("BANCO").disabled= false;
var tercero=document.getElementById("TIPO_TARJETA").disabled= false;
var tercero=document.getElementById("REF").disabled= false;
var tercero=document.getElementById("MONTO").disabled= false;
var tercero=document.getElementById("NRO_APROBACION").disabled= false;
}</script>
 
<table align='center' class='table table-hover table-responsive table-bordered'>
 <tr valign='baseline'>
   <th class='textAligncenter'> <button type="button" name="uno" onclick="activar1()" class= 'btn-sm' ><label> Pago Mixto</label></button></th>
 
<td>
<select id="text1" disabled="disabled" class='form-control'>
<option size="60">Mixto</option>
</select> </td>
 
</table>
<table align='center' class='table table-hover table-responsive table-bordered'>
  <th class='textAligncenter'> <button type="button" name="dos" onclick="activar2()" class= 'btn-sm'>
    <label>Efectivo</label> </button></th>
  <td><input type="text" id="text2" disabled="disabled" size="60" class='form-control'  />
</table>
 
<table align='center' class='table table-hover table-responsive table-bordered'>
  <th class='textAligncenter'> <button type="button" name="tres" onclick="activar3()" class= 'btn-sm'><label>Banco</label>
  </button></th>
 <th class='textAligncenter'>Tarjeta</th>
 <th class='textAligncenter'>Referencia</th>
 <th class='textAligncenter'>Monto (USD)</th>
 <th class='textAligncenter'>Nro Aprobaci�n</th>
 
      <tr valign='baseline'>
     <td>
 
  <select id="BANCO" disabled="disabled" class='form-control' >
    <option value='0171'>BANCO ACTIVO BANCO COMERCIAL, C.A.</option>
       <option value='0115'>BANCO EXTERIOR C.A.</option>
       <option value='0190'>CITIBANK.</option>
    <option value='0121'>CORP BANCA.</option>
    <option value='0137'>SOFITASA</option>
  </select>
    <td> <select id="TIPO_TARJETA" disabled="disabled" class='form-control' >
    <option  >Maestro -Debito</option>
    <option  >Mastercad -Credito</option>
    <option >Visa -Credito</option>
  </select></td>
    <td > <input type="text" id="REF" disabled="disabled" / class='form-control'></td>
 
    <td ><input type="text" id="MONTO" disabled="disabled"  / class='form-control'></td>
 
   <td >  <input type="text" id="NRO_APROBACION" disabled="disabled" class='form-control' /></td>
 
 
</table>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de joel
Val: 3.828
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

funcion para desabiltar campos y select

Publicado por joel (1269 intervenciones) el 04/12/2019 08:43:04
Hola Karollina, donde este el código PHP donde obtienes los valores para almacenarlos en la base de datos?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

funcion para desabiltar campos y select

Publicado por karolina (10 intervenciones) el 04/12/2019 15:25:02
1
2
3
4
5
mysql_select_db($database_sinveck, $sinveck);
$query_pago = "SELECT * FROM pago_banco";
$pago = mysql_query($query_pago, $sinveck) or die(mysql_error());
$row_pago = mysql_fetch_assoc($pago);
$totalRows_pago = mysql_num_rows($pago);
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

funcion para desabiltar campos y select

Publicado por karolina (10 intervenciones) el 04/12/2019 15:44:50
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php require_once('Connections/sinveck.php');
 
 
$TIPO_TARJETA = isset($_GET['TIPO_TARJETA']) ? $_GET['TIPO_TARJETA'] : "";
$BANCO = isset($_GET['BANCO']) ? $_GET['BANCO'] : "";
$REF = isset($_GET['REF']) ? $_GET['REF'] : "";
$MONTO = isset($_GET['REF']) ? $_GET['REF'] : "";
$NRO_APROBACION = isset($_GET['REF']) ? $_GET['REF'] : "";
?>
 
<?php
  echo "<table class='table table-hover table-responsive table-bordered'>";
 
  	echo "   <td><input type='text' id='$TIPO_TARJETA' name='TIPO_TARJETA' value=".$TIPO_TARJETA." style='display:none;' class='form-control'></td>";
	    echo "   <td><input type='text' id='$BANCO' name='BANCO' value=".$BANCO." 'style='display:none;' class='form-control'></td>";
		echo "   <td><input type='text' id='$REF' name='REF' value=".$REF." 'style='display:none;'class='form-control' ></td>";
		echo "   <td><input type='double' id='$MONTO' name='MONTO' value=".round($MONTO,2)." class='form-control'style='display:none;'class='form-control' ></td>";
	    echo "   <td><input type='int' id='$NRO_APROBACION' name='NRO_APROBACION' value=".$NRO_APROBACION." 'style='display:none;'class='form-control' ></td>";
	?>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de José Manuel
Val: 150
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

funcion para desabiltar campos y select

Publicado por José Manuel (62 intervenciones) el 09/12/2019 16:25:07
Hola:

Esos campos que dices de los cuales no obtienes su valor, ¿están deshabilitados? Recuerda que los campos deshabilitados no se envían. ¿Tal vez sea eso?

Si lo es y los necesitas prueba con readonly en vez de disabled. Coméntanos. Un saludo,
https://obelearningservices.com/blog/
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar