djanuary
08-13-2003, 03:09 PM
Hello,
I'm trying to generate a survey to be used through a web interface.
On the start page, I want to collect respondent information, and when the respondent clicks the "start survey" button, I want to verify that the information has been filled out correctly.
After getting by the start page, I want each question to appear in the window by itself. I'm fine with having each question open in its own window, as long as all the information will still be part of the start page's form. I want each question page to have a "next" button that opens the next question.
Finally, I want a submission page to appear that tells the respondent the survey is over and that they should click to submit their answers.
I can do most of this: I set up each question as its own function that writes to the window and had a call to the first question's function as part of an onClick on the "start survey" button. However, I can't get past the first question; that is, when I include as part of the question1 function:
document.write("<input type='button' value='Next' onClick='question2()'>")
Nothing happens when I click the "Next" button that appears under the first question. The functions look like this (atypical caps indicate that this changes across questions):
function questionX(){
document.write("<html>")
document.write("QUESTION<br>")
document.write("<input type='text name='questionX_answer' size='40'>")
document.write("<input type='button' value='Next' onClick='questionY()'>")
}
Can you tell me what's going wrong?
Also, ideally the questions would be presented in a new random order for each subject. This I've butted my head against for too long to think it necessary anymore, but I'd love to have it if it's possible. I was trying to find some way to generate a list of random numbers in an array and call the question functions that correspond to the number in a given array slot, but I couldn't figure out how to do it.
Another thing that I've heard is that IE6 doesn't support mailto: forms. This is the only type of form that I'm used to, so I don't know what to do. Does anyone have a way around this?
Finally (I know this has been a long post--sorry!), I have this nagging fear that, though I think all the form data from the various questions and start page should be in the same form, having each question open in its own page (or rewrite the base page so that it appears by itself) will cause the answers from ealier pages in the sequence to be lost. Can anyone speak to this?
Thanks in advance for any advice or aid!
David
I'm trying to generate a survey to be used through a web interface.
On the start page, I want to collect respondent information, and when the respondent clicks the "start survey" button, I want to verify that the information has been filled out correctly.
After getting by the start page, I want each question to appear in the window by itself. I'm fine with having each question open in its own window, as long as all the information will still be part of the start page's form. I want each question page to have a "next" button that opens the next question.
Finally, I want a submission page to appear that tells the respondent the survey is over and that they should click to submit their answers.
I can do most of this: I set up each question as its own function that writes to the window and had a call to the first question's function as part of an onClick on the "start survey" button. However, I can't get past the first question; that is, when I include as part of the question1 function:
document.write("<input type='button' value='Next' onClick='question2()'>")
Nothing happens when I click the "Next" button that appears under the first question. The functions look like this (atypical caps indicate that this changes across questions):
function questionX(){
document.write("<html>")
document.write("QUESTION<br>")
document.write("<input type='text name='questionX_answer' size='40'>")
document.write("<input type='button' value='Next' onClick='questionY()'>")
}
Can you tell me what's going wrong?
Also, ideally the questions would be presented in a new random order for each subject. This I've butted my head against for too long to think it necessary anymore, but I'd love to have it if it's possible. I was trying to find some way to generate a list of random numbers in an array and call the question functions that correspond to the number in a given array slot, but I couldn't figure out how to do it.
Another thing that I've heard is that IE6 doesn't support mailto: forms. This is the only type of form that I'm used to, so I don't know what to do. Does anyone have a way around this?
Finally (I know this has been a long post--sorry!), I have this nagging fear that, though I think all the form data from the various questions and start page should be in the same form, having each question open in its own page (or rewrite the base page so that it appears by itself) will cause the answers from ealier pages in the sequence to be lost. Can anyone speak to this?
Thanks in advance for any advice or aid!
David