Multiple Links - Next Button
For some reason for the life of me I can't figure this out and posting on the forms is my last results.
I'm trying to create something like this http://powerpetsplus.site88.net/guides/clicker.php
You will see on top I'm trying to get a next button that will go to a new page. The url is something like petid1 and clicking next will go to petid2 and so on. (it's the end URL) example http://www.petadoptworld.com/pages/petpage.asp?PETID1 and I need it to go to http://www.petadoptworld.com/pages/petpage.asp?PETID2 and so on.
I was able to do this with a help of a friend: http://o.aolcdn.com/hss/storage/fss/...test_next.html
but for it to work we have to click the button then the link on top.
What are we doing wrong?
This is the coding I'm using now.
<input type="button" onclick="update();" value="Click me for the next pet">
- <a id="test_link" href="http://www.petadoptworld.com/pages/petpage.asp?petid=1">
<input id="previous" type="hidden" value="1"><br>
var t1 = document.getElementById('test_link');
var v1 = document.getElementById('previous');
t1.href= "http://www.petadoptworld.com/pages/petpage.asp?petid=" + (parseInt(v1.value) + 1);
v1.value = (parseInt(v1.value) + 1);
I'm also trying to figure it out since 8000 are needed if the page is refreshed it remembers what one they are on.