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

Recommended Answers

All 3 Replies

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

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.