Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/04/2004, 11:38
z3r0
 
Fecha de Ingreso: marzo-2003
Mensajes: 106
Antigüedad: 21 años, 1 mes
Puntos: 1
Pregunta Confirmación del Form en ventana pop up

Hola!

Tengo un form que al clickear "OK" abre un pop up window con la pagina de "Enviado correctamente", Anda, pero el browser da error en la barra de información al pie del explorer:


popupWindow(...).document body' null or not an object
Code: 0
URL: ....

No sé que es lo que está mal...

El javascript está en un archivo .js linkeado (anda ok)
Estos son los códigos del form que tengo en la página en html y luego pongo el del archivo .js


Código del HTML QUE TIENE EL FORM:
----------------------------------------------------------------

<form action="formoknewsletter.php" target="ok" method="post" name="newsletter" id="newsletter" onSubmit="GP_AdvOpenWindow('formoknewsletter.php', 'ok','fullscreen=no,toolbar=no,location=no,status= no,menubar=no,scrollbars=no,resizable=no',400,135, 'center','ignoreLink','',2,'');return document.MM_returnValue" >
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><br> <input type=hidden name="recipient" value="mailto:suscribe@killersites.com.ar">
<input type=hidden name="subject" value="Suscribe">
<input type=hidden name="redirect" value="http://www.mysite.com/formoknewsletter.htm">
<span class="smallemphasis"> Suscribe!</span></td>
</tr><tr><td><span class="smallbold">E-mail:
<input name="email" type="text" class="field" onBlur="MM_validateForm('email','','RisEmail');ret urn document.MM_returnValue" size="25">
<input name="okbot" type="image" id="okbot" src="img/okbot.gif" alt="Enviar" align="middle" width="20" height="14" border="0">
</span></td>
<td>&nbsp; </td>
</tr>
</table>
</form></td>


CODIGO DEL ARCHIVO JS
----------------------------------------------------------------

// JavaScript Document
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 ¦¦ p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange')!= -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min ¦¦ max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}

//-->
<!--
function GP_AdvOpenWindow(theURL,winName,features,popWidth, popHeight,winAlign,ignorelink,alwaysOnTop,autoClos eTime,borderless) { //v2.0
var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;
if (popWidth > 0) features += (features.length > 0? ',' : '') + 'width=' + popWidth;
if (popHeight > 0) features += (features.length > 0? ',' : '') + 'height=' + popHeight;
if (winAlign && winAlign!= "" && popWidth > 0 && popHeight > 0) {
if (document.all ¦¦ document.layers ¦¦ document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
if (winAlign.indexOf("center")!= -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
if (winAlign.indexOf("bottom")!= -1) topPos = h-popHeight; if (winAlign.indexOf("right")!= -1) leftPos = w-popWidth;
if (winAlign.indexOf("left")!= -1) leftPos = 0; if (winAlign.indexOf("top")!= -1) topPos = 0;
features += (features.length > 0? ',' : '') + 'top=' + topPos+',left='+leftPos;}
if (document.all && borderless && borderless!= "" && features.indexOf("fullscreen")!= -1) features+=",fullscreen=1";
if (window["popupWindow"] == null) window["popupWindow"] = new Array();
var wp = popupWindow.length;
popupWindow[wp] = window.open(theURL,winName,features);
if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;
if (document.all ¦¦ document.layers ¦¦ document.getElementById) {
if (borderless && borderless!= "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
if (alwaysOnTop && alwaysOnTop!= "") {
ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
if (autoCloseTime && autoCloseTime > 0) {
popupWindow[wp].document.body.onbeforeunload = function() {
if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
window.onbeforeunload = null;}
autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }
document.MM_returnValue = (ignorelink && ignorelink!= "")? false : true;
}
//-->

Alguna ayuda?