PDA

View Full Version : Replace Ids Automatically


luigicannavaro
12-27-2008, 12:56 PM
Hi friends,

Once more into the breach, dear friends, once more;
Henry V - Act III, scene i, lines 1-2

Could I replace Ids automatically based on Css codes and query results (20 per page) ?

Here is the skeleton of my code


<html>
<head>
<script>
function toggleLayer( whichLayer )
{
var elem, vis;
if( document.getElementById ) // this is the way the standards work
elem = document.getElementById( whichLayer );
else if( document.all ) // this is the way old msie versions work
elem = document.all[whichLayer];
else if( document.layers ) // this is the way nn4 works
elem = document.layers[whichLayer];
vis = elem.style;
// if the style.display value is blank we try to figure it out here
if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
</script>

</script>
<style>div#PAPER1 { display: none; }div#PAPER2 { display: none; }div#PAPER3 { display: none; }div#PAPER4 { display: none; }div#PAPER5 { display: none; }div#PAPER6 { display: none; }div#PAPER7 { display: none; }div#PAPER8 { display: none; }div#PAPER9 { display: none; }div#PAPER10 { display: none; }div#PAPER11 { display: none; }div#PAPER12 { display: none; }div#PAPER13 { display: none; }div#PAPER14 { display: none; }div#PAPER15 { display: none; }div#PAPER16 { display: none; }div#PAPER17 { display: none; }div#PAPER18 { display: none; }div#PAPER19 { display: none; }
</style>
</head>
<body>

<%
Dim strConnection, strkeyword, conn, rs, SQL, strSQL,strQuery,mymatch,mymatches,count,haystack,needle, x1
strKeyword = Request.QueryString("look_for")
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath(".\db\ECONOMICSTHEORY.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConnection
Set rs = Server.CreateObject("ADODB.recordset")
%>

<%rs.open " select economics.title, economics.url, economics.bodytext, ECONOMICS.INDEXID from economics ", conn%>

<%do until Rs.EOF%>

<form>
<a href="javascript:toggleLayer('PAPER1');" title="Show/hide abstract">Show/hide abstract</a>
<div id="">
<textarea cols=50 rows=20 >
The Virtual Economy Research Network is a blog style website and research resource examining how virtual property is being bought and sold for real money in marketplaces all round the globe.
</textarea></div>


</form>


<form>
<a href="javascript:toggleLayer('PAPER2');" title="Show/hide abstract">Show/hide abstract</a>
<div id=" ">
<textarea cols=50 rows=20 >
This is part of Cardiff Business School, at University of Wales Cardiff. It provides information and analysis of economic issues in Wales.
</textarea></div>

</form>


<form>
<a href="javascript:toggleLayer('PAPER3');" title="Show/hide abstract">Show/hide abstract</a>
<div id=" ">
<textarea cols=50 rows=20 >
Global Economy Journal is the official publication of the International Trade and Finance Association, and is published in cooperation with Ohio University,
</textarea></div>


</form>


<form>
<a href="javascript:toggleLayer('PAPER4');" title="Show/hide abstract">Show/hide abstract</a>

<div id=" ">
<textarea cols=50 rows=20 >
An online journal co-ordinated and managed by members of the European Political-economy Infrastructure Consortium (EPIC), a European network created by the LSE (London), the WZB (Berlin), the EUI (Florence) and the Juan March Institute (Madrid).
</textarea></div>
</form>

<%rs.MoveNext%>
<%loop%>
<% Rs.close%>
<% conn.close%>
</body>

Best regards

Luigi:D

luigicannavaro
12-29-2008, 01:37 PM
I found the solution.

Luigi