Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/06/2008, 20:14
r0xdrig0
 
Fecha de Ingreso: diciembre-2007
Mensajes: 385
Antigüedad: 16 años, 4 meses
Puntos: 0
Respuesta: Problema al recargar formulario de edicion en php

Hola amigos lo he intentado pero no me funciona (estoy calculando el indice de masa muscular) pero el codigo javascript no me funciona al hacer click en el boton calcular se me sigue recargando la pagina y me sigue imprimiendo el dato traspasado desde mi formulario de busqueda.
NO ME FUNCIONA AYUDA PORFAVOR!!!!! ACA LES DEJO MI CODIGO:
Código PHP:
<?
include_once("../include/common.inc");
include_once(
"../include/comprobaciones.php");
include_once(
"../include/funciones2.php");
include_once(
"../include/funciones_edit.php");
$conn conexion();

/*$CODIGO="select max(ef_codigo) from evaluacion_fisica";
$resultado_codigo= pg_exec ($conn, $CODIGO);
while($row = pg_fetch_array($resultado_codigo))
{
    $ef_codigo=($row[0]+1);    
        
    }*/

        /*    if($_POST['Calcular'])
                {
                    $ef_estatura= $_POST['ef_estatura'];
                    $ef_peso= $_POST['ef_peso'];
                    $imc= $ef_peso/ ($ef_estatura * $ef_estatura); 
                    $total = round ($imc*100)/100;
                    
                    $_POST['i_m_c']=$total;
                    //echo $_POST['i_m_c'];
                }*/
                
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="stylesheet" type="text/css" href="estilos/paginas.css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Modificar Evaluaci&oacute;n F&iacute;sica</title>
</head>

<body>


<h1>Modificar Evaluación Física</h1>
<form id="ingresar_ev_fisica" name="ingresar_ev_fisica" method="post" action="">
<table width="421" border="0">
    <tr>
      <td width="71"><span class="Estilo5"><strong>Fecha:</strong></span></td>
      <td width="340"><span class="Estilo7">
        <?php
fecha_esp
();

?>
      </span></td>
    </tr>
</table>
<hr align="left" width="43%" size="2" color="#8099FF" />





<script type="text/javascript">

function lanzarBuscarCliente()
{
   window.open('../vistas/ver_cliente_inscrito.php', 'ventana','toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=0, width=1100, height=250, left=90, top=235, status=0');
   <!--void(''); -->
}
</script>
      
  <script type="text/javascript">
  function calcular_imc(ef_estatura,ef_peso){
      
        document.ingresar_ev_fisica.i_m_c.value =ef_peso/(ef_estatura*ef_estatura);
        }
  </script>
      
  <table width="421" border="0">
    <tr>
      <td width="106"><strong>Nombre Cliente: </strong></td>
      <td width="305"><label>
      <input name="ef_codigo" type="hidden" class="campo_texto" id="ef_codigo"  readonly="readonly" value="<? echo $ef_codigo_edit?>" />
      
       <input name="cli_nombre" type="text" class="campo_texto" id="cli_nombre" value="<?php echo $cli_nombre_edit?>" />
      </label></td>
    </tr>
    <tr>
      <td><strong>Estatura:</strong></td>
      <td><label>

       <input name="ef_estatura" type="text" class="campo_texto" id="ef_estatura" value="<?php echo $ef_estatura_edit?>" />
      </label></td>
    </tr>
    <tr>
      <td><strong>Peso:</strong></td>
      <td><label>
      
        <input name="ef_peso" type="text" class="campo_texto" id="ef_peso" value="<?php echo $ef_peso_edit?>" />
        <input name="Calcular" type="submit" id="Calcular" value="Calcular" onclick="calcular_imc()" class="boton" />
      </label></td>
    </tr>
    <tr>
      <td><strong>IMC:</strong></td>
      <td><label>
      
        <input name="i_m_c" type="text" class="campo_texto" id="i_m_c" value="<?php echo $i_m_c_edit?>" />
      </label></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
     
        <input name="cli_rut" type="hidden" class="campo_texto" id="cli_rut" value="<?php echo $cli_rut_edit?>" />
      </label></td>
    </tr>
    <tr>
      <td><label>
        <input name="Editar" type="submit" class="boton" id="Editar" value="Editar" />
      </label></td>
      <td><label>
        <input name="Limpiar" type="submit" class="boton" id="reset" value="Limpiar" />
      </label></td>
    </tr>
  </table>
  
  <?


$errores 
= array();
foreach ( 
$_POST as $key => $value )
{
        
$_POST[$key]=trim($_POST[$key]);
}    
if (!
validar_ev_fis_edit($_POST) )
{
    if (
$_POST && $_POST['Editar'])
    {
        if (
$errores)
        {
            echo 
'<p class="error"><b>El formulario contiene errores:</b></p><ul>';
            foreach (
$errores as $key => $value 
            {
                 echo 
'<li>'.$errores[$key]."</li>";
            }
        echo 
'</ul>'
        }   
    }
}
if (
validar_ev_fis_edit($_POST) )
{
    if (
$_POST && $_POST['Editar'])
    {
        
editar_ev_fis();
    }
}
?>
  <p>&nbsp;</p>
</form>

</body>
</html>
de antemano gracias espero me puedan ayudar