I am building a survey that will be used from the browser (IE 6). The clients would like the respondent to choose their main category of interest from a radio button group - and then have the corresponding section of the survey open up.
There are lots of questions on the survey and our main hopes are to get people to answer the questions that deal with their main ‘issue’. We would also like the respondent to be able to answer as many of the other questions as they’d like. We don’t want to show them all of the questions at once - that could be overwhelming.
Is there a way to do this? I’ve seen instructions on how to (sort of) do this in javascript (http://www.delphifaq.com/faq/javascript/f1030.shtml) but that hides the sections (actually divs).
I like the idea of using twisties, but haven’t figured out if there’s a way to open just 1 twistie programmatically.
Any ideas would be appreciated. TIA!
Julie
Subject: web - way to get 1 section to expand but not all? - let user expand others via twistie as desired
Hi,
Design your page with section and put the following code in JS Header…
Now when ever user select category, call "manageSection() function and pass appropriate section number as parameter.
Domino gives number to section as its appeared in form, from top to bottom(1 to NNN).
function _dSectionExpand(sec) {
manageSection(sec)
}
function _dSectionCollapse(sec) {
manageSection(sec)
}
function manageSection(secNo)
{
//get the current state of section
var stateOfcSec = document.all["cSec"+ secNo].style.display;
var stateOfxSec = document.all["xSec"+secNo].style.display;
'Declare a variable to hold the No of Sections on form.
var NoOfSection = 3
for (var i = 1 ; i <= NoOfSection ; i++)
{
if ( secNo == i)
{
document.all["cSec"+i].style.display = stateOfxSec;
document.all["xSec"+i].style.display = stateOfcSec;
}
else
{
document.all["cSec"+i].style.display = ""
document.all["xSec"+i].style.display = "none";
}
}
}
I hope this is the code which you are looking for. But as you want to put these category in section, what if user will click on section directly instead of selecting category from radio button group.
Subject: I’ll try it - but we want user to be able to fill out other sections, too
I’ll try your code, but I’m wondering if it will quite fit with what we want.
We want the person to use the first radio group to say ‘this is the main reason I’m leaving the company’ and have that section of the survey opened up for them (to make it easy for them). But, we also want them to be able to open the other sections of the survey so they can also give us feedback on other topics. For example, their main reason for leaving might be pay and benefits, but their secondary reason might be because they didn’t receive adequate training.
I’ll give it a try - thanks for your assistance.
Julie
Subject: RE: I’ll try it - but we want user to be able to fill out other sections, too
okay…if this is the requirment, then i am sure this code will work…because it allow user to open the section manually as well as on radio button selection.
Subject: RE: I’ll try it - but we want user to be able to fill out other sections, too
You could create your form with all the sections/questions that you want. You can use various subforms to insert them as you need. But the main thing is that you can Previous and Next buttons to display the various section. Each section would be within a
and the Previous and Next button would simply show the next or previous section.
HTH