Foros del Web » Programando para Internet » Javascript »

Campos Dinamicos JavaScript

Estas en el tema de Campos Dinamicos JavaScript en el foro de Javascript en Foros del Web. <?php $onload =""; print_r($_REQUEST); ?> <html lang="es"> <head> <script language="JavaScript" type="text/javascript"> function fncGuardar() { //if (document.form1.elements[0].value==0) //{ // alert('Por favor ingresar el proveedor'); // return ...
  #1 (permalink)  
Antiguo 27/01/2015, 14:47
 
Fecha de Ingreso: abril-2004
Ubicación: cali
Mensajes: 32
Antigüedad: 20 años
Puntos: 0
Campos Dinamicos JavaScript

<?php
$onload ="";
print_r($_REQUEST);

?>


<html lang="es">
<head>
<script language="JavaScript" type="text/javascript">

function fncGuardar()
{

//if (document.form1.elements[0].value==0)
//{
// alert('Por favor ingresar el proveedor');
// return false;
//}

if (document.form1.fecha1.value=="")
{
alert('Por favor ingresar la fecha inicial');
return false;
}
if (document.form1.fecha2.value=="")
{
alert('Por favor ingresar la fecha final');
return false;
}
if (document.form1.fecha2.value=="")
{
alert('Por favor ingresar la fecha final');
return false;
}
if (document.form1.fecha2.value < document.form1.fecha1.value )
{
alert('La fecha final es menor que la fecha inicial');
return false;
}
var movimiento= document.form1.cantidad_lineas.value;
//alert (movimiento);
if (movimiento=="" )
{
alert('El convenio no tiene movimiento');
return false;
}
if (movimiento!="" )
{
if (document.form1.cantidad_lineas.value>0)
{
var contador1= document.form1.cantidad_lineas.value;
for ( var control=1; control<=contador1; control++ )
{
alert(document.getElementById('visible'+control).v alue) ;
alert(document.getElementById('f2_descuento'+contr ol).value) ;
}
}
}




document.getElementById("form1").action="Convenios _pru.php";
document.getElementById("form1").submit();
}




</script>



<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Convenios Comerciales</title>
</head>

<body onload="<?php echo $onload ?>">
<form id="form1" action="control.php" name="form1" method="post" onsubmit="return fncGuardar()">




<?php
echo "<div class='formulario'>";
echo "<table id='formulario' align='center'>";
echo "<tr>";
echo "<td align='left'>Fecha Inicial</td>";
echo "<td align='left' ><input type='text' id='fecha1' name='fecha1' value='".$_POST[fecha1]."' size='8' maxlength='8'></td>";
echo "</tr>";
echo "<tr>";
echo "<td align='left'>Fecha Final</td>";
echo "<td align='left'><input type='text' id='fecha2' name='fecha2' value='".$_POST[fecha2]."' size='8' maxlength='8'></td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<div class='formulario'>";
echo "<table id='formulario' border='0'>";
echo "<tr>";
echo" <td>&nbsp;</td>";
echo" <td>&nbsp;</td>";
echo" <td>&nbsp;</td>";
echo" <td>&nbsp;</td>";
echo "</tr>";
echo "</table>";

echo "<table id='formulario' border='1' align='center'>";
echo "<tr>";
echo " <td colspan='6' bgcolor='#99CC99'><div align='center'><strong><font size='2' face='Arial, Helvetica, sans-serif'>Descuento Simple</font></strong></div></td>";
echo "</tr>";
echo "<td align='center' width='20%'>Nivel </td>";
echo "<td align='center' width='10%'>Descuento </td>";
echo "<td align='center' width='10%'>valor </td>";
echo "<td align='center' width='10%'>Periodo </td>";
echo "<td align='center' width='10%'>Cuotas </td>";
echo "<td align='center' width='10%'>Eliminar </td>";
echo "</tr>";
for ($i=1;$i<=$_POST['cantidad_lineas'];$i++)
{

if($_POST['visible'.$i]==1)
{
echo "<tr style ='color;black;'>";
echo "<td align='center'><input name='f2_descuento".$i."' id=f2_descuento".$i."' value ='".$_POST['f2_descuento'.$i]."' size='8' maxlength='8'></td> ";
echo "<td align='center'><input name='f2_valor".$i."' value ='".$_POST['f2_valor'.$i]."' size='8' maxlength='8'></td> ";
echo "<td align='center'><input name='f2_cuota".$i."' value ='".$_POST['f2_cuota'.$i]."' size='8' maxlength='8'></td> ";
//echo "<td align='center'><button name='eliminar' value ='".$i."'>eliminar</button></td> ";
echo "<td align='center'><button name='eliminar' value ='".$i."' onClick='delineauno()'/>eliminar</button></td> ";
//echo "<td align='center'><input type='button' name='eliminar' value='Agregar Linea' onClick='addlineauno()'/>";
echo "</tr>";
}
echo "<input type='hidden' id='visible".$i."' name='visible".$i."' value='".$_POST['visible'.$i]."'>" ;

}
echo "<td align='right' colspan='6'>";
//echo "<button name='agregar' value='agregar'>Agregar Linea </button>";
echo "<input type='button' name='addlinea1' value='Agregar Linea' onClick='addlineauno()'/>";
echo "<input type='hidden' name='cantidad_lineas' value='".$_POST['cantidad_lineas']."'>" ;
echo "</tr>";
echo "</table>";


?>
<input type="submit" name="btnGuardar" value="Guardar"/>
<input type="reset" name="btnLimpiar" value="Limpiar"onClick="javascript:location.href=' Convenios_pru.php'">

<input type="hidden" id="comando" name="comando" value="insertar"/>
</form>

</body>
</html>

Etiquetas: campos, dinamicos, formulario, html, input, php, valor
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 08:13.