Ver Mensaje Individual
  #3 (permalink)  
Antiguo 10/08/2005, 11:09
Avatar de mauricio2004
mauricio2004
 
Fecha de Ingreso: marzo-2004
Mensajes: 264
Antigüedad: 20 años, 5 meses
Puntos: 0
no me resulto ahora los estoy probando en una pagina mas chica, pero no me esta resultando, el codigo quedo asi

Código:
<script language="javascript" type="text/javascript">
<!--
function valida(theForm)
{
if ( theForm.nombre.value == "" )
{
	alert("El perfil debe tener un nombre.");
	focus(theForm.nombre.value);
	return (false);
}
return (true);

}
-->
</script>
y el formulario


Código HTML:
<form action="<? echo $PHP_SELF; ?>" method="POST" enctype="multipart/form-data" name="form" target="principal" onSubmit="return valida(this); self close()">
  <input type=hidden name=arrabal value=0>
  <table width="90%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#CCCCCC">
    <tr> 
      <td width="50%">Nombre del Perfil </td>
      <td width="50%"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="70%"> <font size="2"> 
              <input type=text name=nombre size=20 value="<? echo $datos[1] ?>">
              </font></td>
            <td width="30%"><font color="#999999">[Ej. 001]</font></td>
          </tr>
        </table></td>
    </tr>
    <tr> 
      <td width="50%">Descripci&oacute;n del Perfil </td>
      <td width="50%"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="70%"> <font size="2"> 
               <textarea name="descripcion" cols="20"><? echo $datos[2] ?></textarea>
              </font></td>
            <td width="30%">&nbsp;</td>
          </tr>
        </table></td>
    </tr>
     <tr> 
      <td width="50%">Initial</td>
      <td width="50%"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="70%"> <font size="2"> 
              <input name=initial type=text id="initial" size=20 value="<? echo $datos[3] ?>">
              </font></td>
            <td width="30%"><font color="#999999"></font></td>
          </tr>
        </table></td>
    </tr>
    <tr> 
      <td width="50%">Renewal</td>
      <td width="50%"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="70%"> <font size="2"> 
              <input name=renewal type=text id="renewal" size=20 value="<? echo $datos[4] ?>">
              </font></td>
            <td width="30%"><font color="#999999"></font></td>
          </tr>
        </table></td>
    </tr>
    <tr> 
      <td width="50%">&nbsp;</td>
      <td width="50%"><font face="Arial, Helvetica, sans-serif" size="2">
		
		
		<input name="modificar" type="image" id="modificar" src="AccionImages/b_modificar.gif" alt="Modificar Perfil" border="0">
		<input type="hidden" name="id_producto" value="<? echo $id_producto ?>">
					<input name="modificar" type="hidden" id="modificar" value="modificar">
      </font></td>
    </tr>
  </table>
</form> 

lo que pasa ahora es que ahora no me esta cerrando la ventana y no esta pasando por la funcion validar


miren si saco self close() que se supone que es para cerrar el popup , este me lo valida los campos pero no me cierra el popup, ahora si le meto el codigo de nuevo onSubmit="return valida(this); self close()" ese no me valida ni me lo cierra

por favor alguien que me ayude, a ver si se puede sacar




Saludos

Mauricio

Última edición por mauricio2004; 10/08/2005 a las 11:20