axtech
going with the flow Posts:35
|
10-12-2009 05:01 AM |
|
Hi
I have made a questionnaire using dynamic forms and each page has 1 question all together there are 5 questions. I will be passing values using session variables. One thing that I don’t understand is that when I will be submitting my last question I want to display the results of all the questions or I want to see the summary of all the questions.
I am using 02.70.53 version of dynamic forms.
Q1 - I want to see all 5 questions with answers on the last page.
Q2 - Depending on how many answers are YES we have to redirect the pages accordingly. i.e if there are 2 YES out of 5 go to page 3 and if there are 3 YES go to page 4.
Can anyone please tell me how it can be done ?
|
|
|
|
|
David To
river guide Posts:2719
|
10-12-2009 06:51 AM |
|
1) Make sure on your last page to have all the shortfield names (all five questions) and have them be retrieve from session variables. 2) As for error trapping for number of YES responses, you can accomplish this with client side javascript and hidden field. Another words, use client side javascript to total the number of YES response and set it equal to a hidden field. Then set up Redirect / URL form completion event to redirect user to different pages depending on the hidden field response. Hope this answers your questions. Please try it out and if you still have problems, simply reply to this forum post. -- David |
|
|
|
|
axtech
going with the flow Posts:35
|
10-12-2009 07:42 AM |
|
How to use client side javascript to total the number of YES response ?
Can you please tell me ? |
|
|
|
|
David To
river guide Posts:2719
|
10-12-2009 08:38 AM |
|
Well, on your last page, you have five fields that retrieve from session variables aid will have a "Yes" or "No" value. So in your client side javascript, have a hidden field called: $(TotalYes): Then on each of your question field client side javascript; having something like this: if ($(question1)) == 'Yes' {$(TotalYes) = parseInt($(TotalYes)) + 1;}; Repeat for the rest of the questions and also place this in the Initial Javascript on page load. -- David |
|
|
|
|
axtech
going with the flow Posts:35
|
10-13-2009 02:12 AM |
|
Hi David thanks for the support but i am still confused. I have made 5 forms and i am passing the values using hidden variables and i can see the values of the 5 questions in view results in the backend.
I want to dislay those answers on the front end on the page how can i do that ?
You told : In your client side javascript, have a hidden field called: $(TotalYes):
Do I have to create this field on the last page ? If yes then how will I get the count value in $(TotalYes) ?
I have added this code on every question
if ($(question1)) == 'Yes' {$(TotalYes) = parseInt($(TotalYes)) + 1;};
but you said to add this in the Initial Javascript on page load also. Where is that option ?
|
|
|
|
|
David To
river guide Posts:2719
|
10-13-2009 07:00 AM |
|
On page five create those same exact questions and make sure to retrieve from session variables. Yes, on the last page, you will total up the number of "Yes". Those same exact questions, what's the values? Are they "Yes"? How about exporting your last form to www.betasprings.com (username: host, password: dnnhost) and state your URL / TABID here so I can take a look at the issue? -- David |
|
|
|
|
axtech
going with the flow Posts:35
|
10-13-2009 07:41 AM |
|
Yes I made 5 same question and retrieved the session values which works perfect, but now how to calculate no of YES and according to number of YES i need to redirect to a certain page.
If i send you my HOST details would that be easier ?
Can you please send me a email so that i can send you the details so that you can look it on the site.
Thanks David |
|
|
|
|
axtech
going with the flow Posts:35
|
10-14-2009 05:59 AM |
|
Hi David
I got your email and i have replied you back.
I have emailed you the login details also.
Thanks |
|
|
|
|
David To
river guide Posts:2719
|
10-14-2009 07:19 AM |
|
DONE. $(TotalYes) = 0; if ($(zelfvertrouwen) == 'Ja'){$(TotalYes) = parseInt($(TotalYes)) + 1;}; if ($(zichtbaar) == 'Ja'){$(TotalYes) = parseInt($(TotalYes)) + 1;}; if ($(verkleurd) == 'Ja'){$(TotalYes) = parseInt($(TotalYes)) + 1;}; if ($(jeukt) == 'Ja'){$(TotalYes) = parseInt($(TotalYes)) + 1;}; if ($(jonger) == 'Ja'){$(TotalYes) = parseInt($(TotalYes)) + 1;}; -- David |
|
|
|
|
axtech
going with the flow Posts:35
|
10-14-2009 11:49 AM |
|
Hi David
thanks for the support last thing is there any way that i can display some text under the questions depending on the no of YES.
Thanks Again
|
|
|
|
|
David To
river guide Posts:2719
|
10-14-2009 11:53 AM |
|
Yes, for example create your "read only" textboxes with questions / default values. Make sure under Advance Field Option to hide until triggered by question response. Then create your question events to unhide the textbox based on the value of $(TotalYes). -- David |
|
|
|
|
axtech
going with the flow Posts:35
|
12-07-2009 06:59 AM |
|
Hi David
Everything was working fine suddenly today the Initial Javascript code for page redirection stopped working.
Can you please tell me what could be the reason. Pages were redirecting according to the results but now it seems that Initial Javascript is not working at all.
Is there something that enables Initial Javascript ? |
|
|
|
|
David To
river guide Posts:2719
|
12-07-2009 07:26 AM |
|
HI, what has changed on the website? Did you update DNN or Dynamic Forms or moved some web pages around? I don't see how it can just magically stop working without some update / changes to the form or site. -- David |
|
|
|
|