dynamically visible section: How to? Does it work in Netscape 4.7?

N

NotGiven

I am creating a survey with a question if answered YES, you skip the next
few questions. I need it to only show the next few quesitons IF they anders
NO. Otherwise hide the questions.

I am a novice with Javascript but a decent programmer so I can figure it out
if you give me some direction or ideas.

Many thanks.
 
L

Lee

NotGiven said:
I am creating a survey with a question if answered YES, you skip the next
few questions. I need it to only show the next few quesitons IF they anders
NO. Otherwise hide the questions.

I am a novice with Javascript but a decent programmer so I can figure it out
if you give me some direction or ideas.

The most common, most reliable, and simplest way to do this is to
ask only one question (or a small number) per screen, and let the
server decide which question(s) to display next.

If it's a serious survey, you don't want to limit your population
to only those who have JavaScript enabled, anyway.
 
J

Janwillem Borleffs

NotGiven said:
I am creating a survey with a question if answered YES, you skip the next
few questions. I need it to only show the next few quesitons IF they anders
NO. Otherwise hide the questions.

I am a novice with Javascript but a decent programmer so I can figure it out
if you give me some direction or ideas.

function toggle(show) {
document.getElementById('morequestions').style.display = show ? 'block' :
'none';
}
.....
<input type="radio" value="Yes" onclick="toggle(true)" name="somequestion"
/>Yes<br />
<input type="radio" value="No" onclick="toggle(false)" name="somequestion"
/>No<br />

<span id="morequestions" style="display:block">
....
</span>


HTH,
JW
 
J

Janwillem Borleffs

Janwillem Borleffs said:
function toggle(show) {
document.getElementById('morequestions').style.display = show ? 'block' :
'none';
}
....

Excuse me, I didn't properly read the subject. This will only work in
Netscape 6+.

I have forgotten how this works in Netscape 4, so I must leave this question
open to others.


JW
 
L

Lasse Reichstein Nielsen

Janwillem Borleffs said:
I have forgotten how this works in Netscape 4, so I must leave this question
open to others.

You can't do it in Netscape 4. You can make the questions hidden, but they
will still take up space on the page. Netscape 4 doesn't reflow the content,
so there is no way around that.

I would have recommended just disabeling the questions, but it doesn't seem
like Nescape 4 understands "elem.disabled = true" either.
I don't know if there is anything smart to do.

/L
 
L

Lasse Reichstein Nielsen

Please don't top post.
When you say netcsape 4 , do you mean 4.7? v 4.7 is the one in concern.

I actually mean 4.80, which is the one I have installed. If it doesn't
support something, it's a fair bet that 4.7 won't either.
/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top