Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Multiple Links - Next Button
05-01-2012, 09:11 AM #1
- Join Date
- Nov 2011
- Thanked 0 Times in 0 Posts
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.
05-01-2012, 12:44 PM #2
- Join Date
- Jun 2002
- London, England
- Thanked 2,508 Times in 2,486 Posts
Last edited by Philip M; 05-01-2012 at 01:18 PM.
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.