hi - have the following javascript function that
closes the current window and refreshes the parent window
with a new querystring.
this all works fine but the variable x_datetxt is shown in the querystring as undefined instead of a date
which i have written to the page to make sure it does exist.
there is a twist to this because this variable is part of a loop. on the page, records are written from a recordset in a loop with buttons next to each one...
x_datetxt is different for each record and this may be what is causing the problem.
recordset loop
function to close window and refresh parent
closes the current window and refreshes the parent window
with a new querystring.
this all works fine but the variable x_datetxt is shown in the querystring as undefined instead of a date
which i have written to the page to make sure it does exist.
there is a twist to this because this variable is part of a loop. on the page, records are written from a recordset in a loop with buttons next to each one...
Code:
<img src="images/gotobut.gif" width="37" height="14" border="0" onclick="reload()" />
recordset loop
Code:
<%Do While (Not rs.Eof)
x_cusid = rs("cusid")
x_cusfname = rs("fname")
x_cuslname = rs("lname")
x_cusadd1 = rs("add1")
x_cuspostc = rs("pcode")
x_cushomtel = rs("hphone")
x_cusworktel = rs("wphone")
x_cusmobtel = rs("mphone")
x_motbookid = rs("motbookid")
x_bookid = x_motbookid
x_motbookdate = rs("motbookdate")
x_datetxt = x_motbookdate
%>
<tr id="cusrow1">
<td bgcolor="#F5F5F5" class="mfitsml">
<%response.Write(x_datetxt)%>
</td>
<td bgcolor="#F5F5F5" class="mfitsml"><%response.Write(x_cusfname) & " " & (x_cuslname) & " " & (x_cuspostc)%></td>
<td bgcolor="#F5F5F5" class="mfitsml"> <div align="center"><img src="images/gotobut.gif" width="37" height="14" border="0" onclick="reload()" style='cursor: hand;'/>
</div></td>
</tr>
<%rs.MoveNext
Loop
function to close window and refresh parent
Code:
<script type="text/javascript">
function reload(){
opener.location = opener.location + "&motdate=" + <%=Server.URLEncode(x_datetxt)%>
self.close();
}
</script>