0

I'm creating a Q&A page with a series of questions, and I was hoping I could have them display one at a time, with "back" and "next" buttons to cycle through them. What I've found while searching is buttons that mimic the browsers back/next buttons, but that's not what I'm looking for. I want the larger Q&A page to be static (I have it set up with SSI, by the way) and have the buttons cycle through text boxes, or html subpages. Is there a simple way to do this, or does it require something like javascript?

Thanks for any help,

V

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Milindo
0

Why don't you use iframe Frames?
Yes, it would require a bit of JavaScript, but I think a little.
For example, (assuming that all the QA is accesale ny a url www.QA.org/qa_num

<iframe id="myFrame" src="www.QA.org/1.html" width="100px" height = "100px">i am the text you will see if your browser can't support iframe</iframe>
<button onclick = "goUp(); ">Up</button>
<button onclick = "goDown(); ">Down</button>

<script>
function GoUp() {
var number = document.getElementById("myFrame").src;
number = number.substring(number.length - 6 ,number.length-5);
number = parseInt(number) + 1; 
document.getElementById("myFrame").src = "www.QA.org/" + number + ".html";
} 
function goDown() {

function GoUp() {
var number = document.getElementById("myFrame").src;
number = number.substring(number.length - 6 ,number.length-5);
number = parseInt(number) - 1; 
document.getElementById("myFrame").src = "www.QA.org/" + number + ".html";
} 
}
</script>

Incomplete code but as near as I can get without knowing the URL

--Milindo

0

What if the user has opted to turn off javascript?

You could use a server side language to pass the values of each form field on to the final page. PHP or Coldfusion works really well doing this type of project. Another advantage to using server side scripts is the fact that you can save the surveys to a database and call them at anytime to display, track, and manipulate the data gathered.

Edited by teedoff: n/a

0

What if the user has opted to turn off javascript?

You could use a server side language to pass the values of each form field on to the final page. PHP or Coldfusion works really well doing this type of project. Another advantage to using server side scripts is the fact that you can save the surveys to a database and call them at anytime to display, track, and manipulate the data gathered.

Yes, that's a good idea. I thought I'd post only HTML, CSS and JS as this is in that category.

Another idea would be to add the plain HTML links in each page of the QA.html files themselves and then put them in a iframe. That's pure HTML (maybe some CSS) so no scripting is involved

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.