Hi,
I am complete JavaScript novice and would really appreciate some help with
this code:
=============== =============== =============== =============== =========
<%@LANGUAGE="VB SCRIPT" CODEPAGE="1252" %>
<!--#include file="Connectio ns/ssdb.asp" -->
<%
Dim rs_news_edit
Dim rs_news_edit_nu mRows
Set rs_news_edit = Server.CreateOb ject("ADODB.Rec ordset")
rs_news_edit.Ac tiveConnection = MM_ssdb_STRING
rs_news_edit.So urce = "SELECT * FROM tblnews"
rs_news_edit.Cu rsorType = 0
rs_news_edit.Cu rsorLocation = 2
rs_news_edit.Lo ckType = 1
rs_news_edit.Op en()
rs_news_edit_nu mRows = 0
%>
<%
Dim Repeat1__numRow s
Dim Repeat1__index
Repeat1__numRow s = -1
Repeat1__index = 0
rs_news_edit_nu mRows = rs_news_edit_nu mRows + Repeat1__numRow s
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL
and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QuerySt ring
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_rem oveList,MM_next Item,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem &
Server.URLencod e(Request.Query String(MM_item) )
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_rem oveList,MM_next Item,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem &
Server.URLencod e(Request.Form( MM_item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the
strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBo th, Len(MM_keepBoth ) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepUR L, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepFo rm, Len(MM_keepForm ) - 1)
End If
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(fir stItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<html>
<head>
<title>ss</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
..showSwitch {
display: block;
font-family: Georgia, "Times New Roman", Times, serif;
color: #FF0000;
}
..hideSwitch {
display: none;
font-family: Georgia, "Times New Roman", Times, serif;
color: #FF0000;
}
</style>
<script>
function showHideSwitch2 (theid, value) {
if (document.getEl ementById) {
switch_id = document.getEle mentById(theid) ;
if (value == 'show') {
switch_id.class Name = 'showSwitch';
}else{ switch_id.class Name = 'hideSwitch';
}
}
}
</script>
<style type="text/css">
<!--
-->
</style>
</head>
<body background="Ima ges/BG.jpg">
<table width="100%" height="100%" border="0" align="center" cellpadding="0"
cellspacing="0" >
<tr>
<td align="center" valign="middle" >
<table width="700" height="600" border="1" align="center" cellpadding="0"
cellspacing="0" bordercolor="#B 1D3EC">
<tr>
<td bgcolor="#FFFFF F">
<table width="100%" height="100%" border="0" align="center"
cellpadding="0" cellspacing="0" >
<tr>
<td><div align="left">&n bsp;   ; <img
src="Images/edit_news.jpg" width="142" height="40"></div></td>
</tr>
<tr>
<td><p align="center"> </p>
<p align="left">&n bsp;</p>
<table width="95%" border="0" align="center"
cellpadding="0" cellspacing="0" >
<%
While ((Repeat1__numR ows <> 0) AND (NOT rs_news_edit.EO F))
%>
<tr>
<td width="28%"><p
align="left"><% =(rs_news_edit. Fields.Item("ne ws_summary").Va lue)%></p>
<p> </p></td>
<td width="28%"><di v align="center">
<p><%=(rs_news_ edit.Fields.Ite m("news_complet e").Value)%> </p>
<p> </p>
</div></td>
<td width="28%">&nb sp;</td>
<td width="16%">
<div align="center">
<p align="right">< a href="edit_news _01.asp?<%=
MM_keepURL & MM_joinChar(MM_ keepURL) & "id=" &
rs_news_edit.Fi elds.Item("id") .Value %>">Change</a>
</p>
<p> </p>
</div></td>
</tr>
<tr>
<td colspan="4"><p align="left"><a href="javascrip t:;"
onClick="showHi deSwitch2('swit ch4', 'show')">open
4</a>
<a href="javascrip t:;" onClick="showHi deSwitch2('swit ch4', 'hide')">close
4</a>
<p class="hideSwit ch" id="switch4"><t able width="75%" border="1"
align="center">
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
</table></p></p>
</td>
</tr>
<tr>
<td colspan="4"><hr ></td>
</tr>
<tr>
<td colspan="4">&nb sp;</td>
</tr>
<%
Repeat1__index= Repeat1__index+ 1
Repeat1__numRow s=Repeat1__numR ows-1
rs_news_edit.Mo veNext()
Wend
%>
</table>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p></td>
</tr>
</table></td>
</tr>
<tr>
<td height="10" bgcolor="#B1D3E C"> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
rs_news_edit.Cl ose()
Set rs_news_edit = Nothing
%>
=============== =============== =============== =============== =========
The problem is that the table with the '1's in it does not appear in each
repeat region bit, so for example if you clicked on the 5th repeated region
section the table would still open in the first section with the included
dynamic data also from the first item
Is there anyway I can fix this ?
Thanks in advance,
Andy.
Comment