I have a doubt about this problem, for example if the condition is equal to “ACEPTADA” it must show the div#devAceptada and hide div#devRechazada otherwise if the condition is equal to “RECHAZADA” show the div#devRechazada and hide div#devAceptada all is okay and yes it works! but if the form must show all the data from an unique ID, i mean in one part show div#devAceptada and the other input shows too if the condition is correct, now in other part show div#devAceptada and over this the input is hide because if the condition is “ACEPTADA” it must show all the input over the div#devAceptada, i dont know if i need the bucle or something, im open for your advices or suggestions.
HTML
<select name="devolucion" onchange="mostrar(this)" >
<option
<?php
if ($columna['resultado_revision'] == "") {
echo "disabled selected";
}
?>
>Seleccion una opción</option>
<option
<?php
if ($columna['resultado_revision'] == "ACEPTADA") {
echo "selected";
}
?>
>ACEPTADA</option>
<option
<?php
if ($columna['resultado_revision'] == "RECHAZADA") {
echo "selected";
}
?>
>RECHAZADA</option>
</select>
PHP
outside the tag select is:
<?php
if($columna['resultado_revision'] == "ACEPTADA"){
echo "<script type='text/javascript'>";
echo "document.getElementById('comaEmbarques').style.display = 'block';";
echo "document.getElementById('devAceptada').style.display = 'block';";
echo "</script>";
} else if($columna['resultado_revision'] == "RECHAZADA"){
echo "<script type='text/javascript'>";
echo "document.getElementById('comaEmbarques').style.display = 'block';";
echo "document.getElementById('devRechazada').style.display = 'block';";
echo "</script>";
}
?>
DIVS TO SHOW
<div class="comEmb">
<select id="devAceptada" name="comaEmbarques" style="display:none">
<option disabled selected value=""
<?php
if ($columna['com_cdd_emb'] == " ") {
echo "disabled selected";
}
?>
>Seleccion una opción</option>
<option value="REALIZAR NOTA DE CREDITO"
<?php
if ($columna['com_cdd_emb'] == "REALIZAR NOTA DE CREDITO") {
echo "selected";
}
?>
>REALIZAR NOTA DE CREDITO</option>
<option value="REALIZAR NOTA DE CREDITO Y ENVIAR PRODUCTO A SUC. POTASIO"
<?php
if ($columna['com_cdd_emb'] == "REALIZAR NOTA DE CREDITO Y ENVIAR PRODUCTO A SUC. POTASIO") {
echo "selected";
}
?>
>REALIZAR NOTA DE CREDITO Y ENVIAR PRODUCTO A SUC. POTASIO</option>
</select>
<!-- CONFIRMAR PARA COMPROBAR SI ES ACEPTADA O NO A PARTIR DEL RESULTADO DE LA DEVOLUCIÓN -->
<select id="devRechazada" name="comaEmbarques" style="display:none">
<option disabled selected value=""
<?php
if ($columna['com_cdd_emb'] == "") {
echo "selected";
}
?>
>Selecciona una opción</option>
<option value="REGRESAR PRODUCTO AL PUNTO DE VENTA"
<?php
if ($columna['com_cdd_emb'] == "REGRESAR PRODUCTO AL PUNTO DE VENTA") {
echo "selected";
}
?>
>REGRESAR PRODUCTO AL PUNTO DE VENTA</option>
<option value="ENVIAR A POTASIO COMO PRODUCTO DE BAJA"
<?php
if ($columna['com_cdd_emb'] == "ENVIAR A POTASIO COMO PRODUCTO DE BAJA") {
echo "selected";
}
?>
>ENVIAR A POTASIO COMO PRODUCTO DE BAJA</option>
</select>
</div>
The Results:
All is in the same ID:
Remember all the part is in the same web with an unique ID
please help me