Hi guys, im new to ASP so please be kind. I have been creating an ASP survey based on an open-source survey by Guo Xu from planet source code. anyway, it is basically a multiple choice survey where users firstly enter their details, and then answer a series of multiple choice questions. You can see this here http://www.beaniekids.com/test/bkq2/user_details.asp . This survey uses an Access database which can be downloaded here: http://www.beaniekids.com/test/bkq2/survey.mdb My Question is, How can i skip questions.... For example, the first question asks if a user is male or female. If they answer MALE i want it to skip to Question 3 instead of going to Question 2. How can this be done. i have tried a number of times but cant seem to do it... i have attached the text asp files for The questionnaire (which is one page that displays each question). i have also attached the proceed and tally asp text files which are called after each question is answered (if you need any more files let me know and ill post up). If you could show me the code to use would be greatly appreciated.
Looks like you have the current question stored/passed in Request.Querystring("QC"). Instead of putting the querystring directly on the ACTION attribute of the FORM element, make it a hidden input: <form action="proceed.asp" method="post"> <input type="hidden" name="QC" value="<%=request.querystring("QC")%>"> Code (markup): Then, you can use javascript so that when they click on the "Male" radio box, it changes the value of the hidden input to be QC+1 (to skip a question).
Something like: <input type="radio" name="gender" value="male" onclick="document.form1.qc.value=3;"> Male <input type="radio" name="gender" value="female" onclick="document.form1.qc.value=2;"> Female Code (markup): Of course you'll have to put name="form1" on the form tag. To make it browser independent you'll have to use something like theDoc as a variable to reference the document object, and in the header script use some browser-independent code to create the theDoc variable. document.whatever only works in IE I think.