Hola Amigos, esto esta bien raro asi que les comento: Desde una pagina que tiene un campo de texto, usando una función javascript window.open abro otra ventana; esta ventanita tiene un doble porposito, el primero es que al llenar el formulario y enviarlo, pase el contenido de esta a la ventana padre, y la segunda es que en ella misma se llame pero pasando un parametro que llama codigo para mandar un correo.
Aqui lo raro es que cuando termina de cargar la pagina ejecutando del codigo de mandar el correo. la ventana se recarga de nuevo SOLA, mostrandome de nuevo el formulario para llenar.
Les dejo copia del codigo a ver si alguno se le ocurre que puede estar pasando.
<%@LANGUAGE="VBSCRIPT"%>
<% Session.LCID = 2058'Set the server locale %>
<!--#include file="../includes/bandera.inc"-->
<HTML>
<%
If Request.QueryString("EnviarCorreo") = 1 Then
%>
<!--#include file="../Connections/conIgnis.asp" -->
<!--#include file="../includes/envio_mail.asp"-->
<%
If Request.QueryString("chkNotCliente") Then
%>
<%
Dim rsTicket__MMColParam
rsTicket__MMColParam = "1"
If (Request.QueryString("IdTicket") <> "") Then
rsTicket__MMColParam = Request.QueryString("IdTicket")
End If
%>
<%
Dim rsTicket
Dim rsTicket_numRows
Set rsTicket = Server.CreateObject("ADODB.Recordset")
rsTicket.ActiveConnection = MM_conIgnis_STRING
rsTicket.Source = "SELECT IdTicket, Nombre, Apellidos, Email FROM dbo.TroubleTickets WHERE IdTicket = " + Replace(rsTicket__MMColParam, "'", "''") + ""
rsTicket.CursorType = 0
rsTicket.CursorLocation = 2
rsTicket.LockType = 1
rsTicket.Open()
rsTicket_numRows = 0
%>
<%
End If
%>
<%
Dim vIdTicket
Dim vSeguimiento
vIdTicket = Request.Querystring("IdTicket")
Mensaje = Request.QueryString("Seguimiento")
%>
<%
Else
%>
<script language=javascript>
function Trim(s) {
while (s.substring(0,1) == ' ') {
s = s.substring(1,s.length);
}
while (s.substring(s.length-1,s.length) == ' ') {
s = s.substring(0,s.length-1);
}
return s;
}
function envia()
{
debugger
if(Trim(document.demoform.Text.value) != "")
{
//Aqui es donde le pasas los valores
window.document.demoform.Submit.disabled;
window.opener.document.consulta.txaSeguimiento.val ue = window.opener.document.consulta.txaSeguimiento.val ue + (document.demoform.dc.value)+' '+(document.demoform.timehora.value)+':'+(document .demoform.timemin.value)+' hrs.\n'+(document.demoform.Text.value)+'\n<%= Trim( Session("Login") ) %>\n\n';
<%
If (OnFollowNotifyMonitor = 1 OR OnFollowNotifyClient = 1) AND (AllowFollowNotify1Level = 1)Then
%>
window.location.href = 'Seguimiento.asp?IdTicket=<%=Request.QueryString(" IdTicket")%>&Seguimiento=' + (document.demoform.dc.value) + ' ' + (document.demoform.timehora.value) + ':' + (document.demoform.timemin.value) + ' hrs.\n' + (document.demoform.Text.value) + '<%= Trim( Session("Login") ) %>&chkNotCuenta=' + document.demoform.chkNotCuenta.checked + '&chkNotCliente=' + document.demoform.chkNotCliente.checked + '&EnviarCorreo=1';
<%
Else
%>
window.close;
<%
End If
%>
}
else
{
alert("No ha colocado el texto del seguimiento");
}
}
</script>
<%
Dim fecha, hora, min, texto
%>
<%
End If
%>
<HEAD>
<script src="../includes/Fecha.js"></script>
<TITLE>Ignis :: Seguimiento de ticket</TITLE>
<link href="../Css/Ignis.css" rel="stylesheet" type="text/css">
</HEAD>
<%
If Request.QueryString("EnviarCorreo") = 1 Then
stop
%>
<body>
<form name="form1" action="">
<img src="../Imagenes/LogoIgnis.jpg" width="227" height="90">
<table width="300" border="1" align="center" cellpadding="2" cellspacing="0" class="Contenido">
<tr>
<td width="404" class="Labels">Notificaciones de Seguimiento. </td>
</tr>
<tr>
<td>Las siguiente(s) Notificaciones fueron enviadas.</td>
</tr>
<%
If Request.QueryString("chkNotCuenta") Then
Temp = envio_mail(SMTPOnFollowNotify,"
[email protected]" ,"Servicio de Notificación","",Trim(EmailOnFollowNotifyMonitor), Trim(NameOnFollowNotifyMonitor),Replace(Replace(Su bjectOnFollowNotifyMonitor,"<NoTicket>",Request.Qu eryString("IdTicket")),"\n",vbCrLf),Mensaje, False)
%>
<tr>
<td>Notificación a Correo Monitor </td>
</tr>
<%
End If
If Request.QueryString("chkNotCliente") Then
If NOT(rsTicket.Eof) AND (rsTicket.Fields.Item("Email").Value) <> "" Then
Temp = envio_mail(SMTPOnFollowNotify,"
[email protected]" ,"Servicio de Notificación","",Trim(rsTicket.Fields.Item("Email" ).Value),Trim(rsTicket.Fields.Item("Nombre").Value ) & " " & Trim(rsTicket.Fields.Item("Apellidos").Value),Repl ace(Replace(SubjectOnFollowNotifyClient,"<NoTicket >",Request.QueryString("IdTicket")),Chr(34),vbCrLf ),Mensaje, False)
%>
<tr>
<td>Notificación a Correo de Cliente </td>
</tr>
<%
rsTicket.Close()
Set rsTicket = Nothing
End If
End If
%>
<tr>
<td align="center"><a href="cerrarventana.asp">Cerrar</a></td>
</tr>
</table>
</form>
</BODY>
</HTML>
<%
Response.End()
Else
%>
<BODY onLoad="document.demoform.dc.value = fecha()">
<FORM action="" method="POST" name="demoform">
<table width="450" border="1" align="center" cellpadding="0" cellspacing="0" class="Contenido">
<tr>
<td colspan="2" class="Titulo2B">Seguimiento
para el Ticket
<%=Request.QueryString("IdTicket")%> en la Falla </td>
</tr>
<tr>
<td width="50%" align="right">Fecha
de Seguimiento: </td>
<td width="55%"> <input name="dc" size="11" onDblClick="gfPop.fPopCalendar(document.demoform.d c);return false;">
</td>
</tr>
<tr>
<td width="50%" align="right">Hora
de Seguimiento: </td>
<td width="55%"> <script>
with (document) {
var d, h;
d = new Date();
h = d.getHours();
write("<SELECT name='timehora' onchange=\"document.demoform.hora.value = this.options[this.selectedIndex].text\">");
for(var i=0;i<24;i++)
{
write("<OPTION value=\"" +(i<10?"0":"")+i);
if (i == h)
write("\" selected>");
else
write("\">");
write((i<10?"0":"")+i+ "</OPTION>");
}
write("</SELECT>");
}
</script>
:
<script>
with (document) {
var m;
m = d.getMinutes();
write("<SELECT name='timemin' onchange=\"document.demoform.min.value = this.options[this.selectedIndex].text\">");
for(var i=0;i<60;i++)
{
write("<OPTION value=\"" +(i<10?"0":"")+i);
if (i == m)
write("\" selected>");
else
write("\">");
write((i<10?"0":"")+i+ "</OPTION>");
}
write("</SELECT>");
}
</script>
hrs
<input name="hora" type="hidden" id="hora"> <input name="min" type="hidden" id="min"></td>
</tr>
<tr>
<td width="50%" align="right" valign="top">Seguimiento:</td>
<td width="55%"><textarea name="Text" cols="35" rows="5" id="Text"></textarea></td>
</tr>
<tr align="center">
<td height="30" colspan="2" valign="top"><input type="submit" name="Submit" value="Aceptar" onClick="javascript
:envia();"></td>
</tr>
<tr align="left" valign="middle">
<td colspan="2">
<%
If AllowFollowNotify1Level Then
If OnFollowNotifyMonitor = 1 Then
%> <input name="chkNotCuenta" type="checkbox" id="chkNotCuenta">
Notificar de este seguimiento a cuenta monitor <br>
<%
End If
If OnFollowNotifyClient = 1 Then
%>
<input name="chkNotCliente" type="checkbox" id="chkNotCliente">
Notificar de este seguimiento al Cliente
<%
End If
End If
%> </td>
</tr>
</table>
</FORM>
<iframe width=168 height=190 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="ipopeng.htm" scrolling="no" frameborder="0" style="border:2px ridge; visibility:visible; z-index:999; position:absolute; left:-500px; top:0px;">
</iframe>
</BODY>
</HTML>
<%
End If
%>