Foros del Web » Programando para Internet » Javascript »

Actualizar un Iframe

Estas en el tema de Actualizar un Iframe en el foro de Javascript en Foros del Web. Estimados, tengo el siguiente código Código PHP: <? session_start (); if ( $_SESSION [ 'numuser' ]== "" ){ header ( "Location:index.php" ); } ?> <HTML> <HEAD> ...
  #1 (permalink)  
Antiguo 16/10/2012, 08:51
 
Fecha de Ingreso: junio-2012
Ubicación: Santiago de Chile
Mensajes: 164
Antigüedad: 11 años, 10 meses
Puntos: 1
Actualizar un Iframe

Estimados, tengo el siguiente código

Código PHP:

<?
session_start
();
if (
$_SESSION['numuser']==""){
header("Location:index.php");
}
?>
<HTML>
<HEAD>
 <TITLE>Busca Clientes</TITLE>
   <style type="text/css">
table {
  border-collapse: collapse;
  border: 1px solid #4F81BD;
  font: normal 11px verdana, arial, helvetica, sans-serif;
  color: #000000;
  background: #FFFFFF;
  }
td, th {
  border: 1px solid #4F81BD;
  padding: .5em;
  color: #000000;
  }
.odd {
  background: #DBE5F1;
  }
</style>
<script type="text/javascript">

</script>

</HEAD>
<BODY>
<form method="POST" name="form1" action="consulta_clientes.php">
<iframe name="parte1">
<table class="sample" border="1" width="1200">
<tr>
<td>Sucursal: &nbsp &nbsp
<?
include "conectar.php";
?>
<select name="area" width="180" style="width: 180px">
    <option value="">Seleccione Area</option>
    <option value="0">Ford Camiones</option>
    <option value="2">Camiones Usados</option>
    <option value="8">Fortaleza</option>
    <option value="9">Hyundai</option>
    <option value="10">Curimaq</option>
    <option value="11">Usados Livianos</option>
    <option value="14">Ford Livianos</option>
</select> &nbsp &nbsp
Ingrese Rut(Sin puntos)  &nbsp
<input type="text" name="rut" id="rut" size="15">
<input type="submit" value="Buscar">
<!--<input type="button" value="Limpiar" onClick="limpiar()">-->
</tr>
</table>
</iframe>
</form>
<iframe name="parte2">
<?
$area 
$_POST["area"];
$rut $_POST["rut"];

if (
$area!='' || $rut!=''){

if (
$area==0){$extension="_usadospesados";}
if (
$area==2){$extension="_fordcamiones";}
if (
$area==8){$extension="_fortaleza";}
if (
$area==9){$extension="_hyundai";}
if (
$area==10){$extension="_global";}
if (
$area==11){$extension="_usadosliv";}
if (
$area==14){$extension="_fliv";}

echo(
"<table class=titulo width=1200 border=1>");
      echo(
"<tr>");
      echo(
"  <td><h6>Ver</td>");
      echo(
"  <td><h6>Rut</td>");
      echo(
"  <td><h6>Nombre</td>");
      echo(
"  <td><h6>Vendedor</td>");
      echo(
"  <td><h6>Fono</td>");
      echo(
"  <td><h6>Fono2</td>");
      echo(
"  <td><h6>Celular</td>");
      echo(
"  <td><h6>Correo</td>");
      echo(
"  <td><h6>Comuna</td>");
      echo(
"  <td><h6>Direccion</td>");
      echo(
"</tr>");
include 
"conectar.php";
$consulta "SELECT * FROM solicitud_credito WHERE area_usuario=".$area;
if (
$rut!=''){$consulta=$consulta." and rut_cliente like '%".$rut."%'";}
$consulta=$consulta." order by numero DESC";
$result mysql_query($consulta);
if (
mysql_num_rows($result)>0){
   
$i=0;
   
$rows=mysql_num_rows($result);
   while(
$i $rows) {
      echo(
"<tr>");
      echo(
"<td><a href=ver_cliente.php?num=".mysql_result($result$i"num_cliente").">Ver</a></td>");
      echo(
"<td width=100>".mysql_result($result$i"rut_cliente")."</td>");
      echo(
"<td>".mysql_result($result$i"cliente")."</td>");
      
$result1 mysql_query("SELECT * FROM usuarios WHERE num_unico=".mysql_result($result$i"usuario"));
      if (
mysql_num_rows($result1)>0){
      
$z=0;
      echo(
"<td>".mysql_result($result1$z"nombre_largo")."</td>");
      
$z++;
      }
      
$result2 mysql_query("SELECT * FROM empresa".$extension." WHERE Numero=".mysql_result($result$i"num_cliente"));
      if (
mysql_num_rows($result2)>0){
      
$x=0;
         echo(
"<td>".mysql_result($result2$x"fono1")."</td>");
         echo(
"<td>".mysql_result($result2$x"fono2")."</td>");
         echo(
"<td>".mysql_result($result2$x"celular")."</td>");
         echo(
"<td>".mysql_result($result2$x"email_personal")."</td>");
         echo(
"<td>".mysql_result($result2$x"comuna")."</td>");
         echo(
"<td>".mysql_result($result2$x"Direccion")."</td>");
      }else{
      echo(
"<td></td>");
      }
      
$x++;
      echo(
"</tr>");
   
$i++;
   }
}
echo(
"</table>");
}
?>
</iframe>
</BODY>
</HTML>

y quiero solamente actualizar el iframe con id parte2

no lo he podido hacer aún con Js, alguna ayuda???
  #2 (permalink)  
Antiguo 16/10/2012, 08:57
Avatar de mauled  
Fecha de Ingreso: marzo-2005
Ubicación: Cd. de México.
Mensajes: 3.001
Antigüedad: 19 años, 1 mes
Puntos: 33
Respuesta: Actualizar un Iframe

intenta lo siguiente por favor. forosdelweb-javascript

Saludos
  #3 (permalink)  
Antiguo 16/10/2012, 09:25
 
Fecha de Ingreso: junio-2012
Ubicación: Santiago de Chile
Mensajes: 164
Antigüedad: 11 años, 10 meses
Puntos: 1
Respuesta: Actualizar un Iframe

y cómo lo validaría? al presionar el submit con un onchange o onsubmit??? o algo asi??
  #4 (permalink)  
Antiguo 16/10/2012, 09:30
 
Fecha de Ingreso: junio-2012
Ubicación: Santiago de Chile
Mensajes: 164
Antigüedad: 11 años, 10 meses
Puntos: 1
Respuesta: Actualizar un Iframe

Cita:
Iniciado por mauled Ver Mensaje
intenta lo siguiente por favor. forosdelweb-javascript

Saludos

compa perdón, quería actualizar unos DIV....no unos iframes jaja perdón...

Etiquetas: html, iframe, mysql, sql, usuarios
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 05:00.