Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing and recalling click data

Status
Not open for further replies.

nielse63

Technical User
Sep 8, 2009
12
0
0
US
Hi all,

I am really new to all this, and any help with my problems would be awesome. I am working on a function that allows the user to click on a "Good" and "Bad" link, and a number next to it will count the number of times that different users have clicked on each piece of text. Here's the basic version of the code in using:

Code:
<script type="text/javascript">
function add_to_goodcount(){
var goodcount=document.getElementById('goodcount');
var cstore = document.getElementById('good_counter_store');

cstore.value=parseInt(cstore.value)+1;
badcount1.innerHTML=cstore.value;
}
</script>

<a href="javascript:add_to_goodcount();">Good </a><input type="hidden" name="good_counter_store" id="good_counter_store" value='0'><span id="goodcount">0</span>

With this code standing alone, each time a user revists the page the number goes back to zero.

So my question is: How can I store the data in ASP so that when the user visits the site again, the count is restored?
 
I'd recommend using some AJAX to push the button result back to the server and have that repost the new data back to the server.

There is an AJAX forum at here so they should be able to provide some help for you if you need it.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top