I am looking to use my values from addition and subtraction, from javascript, and use them to increment the startRow and endRow values together. I have the addition and subtraction working, and the value being displayed. Now I cannot figure out how to add the value within the quotes. every time I try to use the ## variable markers, it tells me that my variables do not exist. I want to be able to press the next and Previous button and have it show me the former and latter 20 results. `
<cfoutput>
<script type="text/javascript">
var currentValue = 0;
var add = function(valueToAdd){
("adding: " + valueToAdd);
currentValue += valueToAdd;
document.getElementById('number').innerHTML = currentValue;
};
</script>
</cfoutput>
<cfparam name="url.start" default="1" >
<cfquery name="query" datasource="">
</cfquery>
<table>
<cfset totalPages = ceiling(query.recordCount)>
<cfset thisPage = ceiling(url.start)>
<cfloop query="query" startRow="1" endRow="20">
<cfoutput>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</cfoutput>
</cfloop>
</table>
<html>
<head>
</head>
<body>
<div id="text">Results = <span id="number">0</span><div>
<a href="javascript:add(20)">Plus 20 Results</a>
<a href="javascript:add(-20)">Minus 20 Results</a>
</body>
</html>
I removed the database information out of the code.